Skip to content

eachindex docstring is wrong; it doesn't accept arbitrary iterables #58348

Open
@adienes

Description

@adienes
help?> eachindex
search: eachindex eachline lastindex checkindex getindex firstindex

  eachindex(A...)


  **In general eachindex accepts arbitrary iterables, including strings and
  dictionaries,** 

but

julia> d = Dict([:a=>1, :b=>-1])
Dict{Symbol, Int64} with 2 entries:
  :a => 1
  :b => -1

julia> eachindex(d, d)
ERROR: MethodError: no method matching keys(::Dict{Symbol, Int64}, ::Dict{Symbol, Int64})

the docstring should clarify that only the one-arg method supports arbitrary iterables

Metadata

Metadata

Assignees

No one assigned

    Labels

    collectionsData structures holding multiple items, e.g. setsdocsThis change adds or pertains to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions