keys(g::Generator) = keys(g.iter)
is not generically correct and should not be defined
#58341
Labels
breaking
This change will break code
collections
Data structures holding multiple items, e.g. sets
correctness bug ⚠
Bugs that are likely to lead to incorrect results in user code without throwing
design
Design of APIs or of the language itself
from the
keys
docstring:but a
Generator
does not have keys and values. it only has values. there is noget(::Generator, ...)
norgetindex(::Generator, ...)
I believe a similar problem holds for
axes(g::Generator)
andndims(g::Generator)
, but I'm focusing onkeys
since it seems the most flagrant.this leads to awful behavior with things like
where the second call should either error, or maybe a
Generator
could 1-index as if it were anenumerate
so that would becomenote that
so even the
state
initerate
is 1-indexed and not taking fromkeys(g.iter)
I think technically this is a duplicate of #48379, but I don't think the fundamental problem there has anything to do with
skipmissing
so I just made a new issue.The text was updated successfully, but these errors were encountered: