Skip to content

Commit

Permalink
doc: document AbstractDict and AbstractSet (#31206)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and fredrikekre committed Mar 1, 2019
1 parent a3a36c8 commit 323a832
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ const Callable = Union{Function,Type}

const Bottom = Union{}

"""
AbstractSet{T}
Supertype for set-like types whose elements are of type `T`.
[`Set`](@ref), [`BitSet`](@ref) and other types are subtypes of this.
"""
abstract type AbstractSet{T} end

"""
AbstractDict{K, V}
Supertype for dictionary-like types with keys of type `K` and values of type `V`.
[`Dict`](@ref), [`IdDict`](@ref) and other types are subtypes of this.
"""
abstract type AbstractDict{K,V} end

# The real @inline macro is not available until after array.jl, so this
Expand Down
2 changes: 2 additions & 0 deletions doc/src/base/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ for the key `x`). Multiple arguments to `D[...]` are converted to tuples; for e
`D[x,y]` is equivalent to `D[(x,y)]`, i.e. it refers to the value keyed by the tuple `(x,y)`.

```@docs
Base.AbstractDict
Base.Dict
Base.IdDict
Base.WeakKeyDict
Expand Down Expand Up @@ -233,6 +234,7 @@ Partially implemented by:
## Set-Like Collections

```@docs
Base.AbstractSet
Base.Set
Base.BitSet
Base.union
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/conversion-and-promotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ already of the requested type:
convert(::Type{T}, x::T) where {T<:Number} = x
```

Similar definitions exist for `AbstractString`, `AbstractArray`, and `AbstractDict`.
Similar definitions exist for `AbstractString`, [`AbstractArray`](@ref), and [`AbstractDict`](@ref).

## Promotion

Expand Down

0 comments on commit 323a832

Please sign in to comment.