Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SymbolTable.get_identifiers() docstring return value incorrect #93660

Closed
pamelafox opened this issue Jun 9, 2022 · 4 comments
Closed

SymbolTable.get_identifiers() docstring return value incorrect #93660

pamelafox opened this issue Jun 9, 2022 · 4 comments
Labels
docs Documentation in the Doc dir easy

Comments

@pamelafox
Copy link
Contributor

Documentation

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).

I have a PR with a proposed change incoming.

@pamelafox pamelafox added the docs Documentation in the Doc dir label Jun 9, 2022
@pamelafox
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor Author

Sure, typeshed PR is here:
python/typeshed#8054
CPython PR is here:
#93661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy
Projects
None yet
Development

No branches or pull requests

4 participants