You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SymbolTable.get_identifiers() docstring return value incorrect #93660
SymbolTable.get_identifiers() currently says:
"Return a list of names of symbols in this table."
However, the returned value is actually dict_keys, a dictionary view object, which doesn't support everything that a list does (notably, it's not subscriptable).
Alternatively, that method could return a list by wrapping the return value in list(), but that could potentially be backward incompatible so I assume its preferable to just update the documentation.
Activity
pamelafox commentedon Jun 9, 2022
Alternatively, that method could return a list by wrapping the return value in list(), but that could potentially be backward incompatible so I assume its preferable to just update the documentation.
hauntsaninja commentedon Jun 10, 2022
Thanks for spotting this! As an aside, looks like the type in typeshed is also incorrect, in case you feel like making another PR: https://github.com/python/typeshed/blob/ad48606a0d901d907f2428917d7a5f97959b4733/stdlib/symtable.pyi#L21 :-)
pamelafox commentedon Jun 10, 2022
Sure, typeshed PR is here:
python/typeshed#8054
CPython PR is here:
#93661
AlexWaygood commentedon Jun 11, 2022
Fixed in:
Thanks, @pamelafox!