| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Per my PR to cpython (python/cpython#93661), the documentation for SymbolTable.get_identifiers incorrectly says it returns a list, and thats what typeshed currently says as well.
This PR changes it to return dict_keys[str, int]
Here's code that shows get_identifiers in action:
>>> import symtable >>> code = """ ... def calc_pow(a, b): ... return a ** b ... a = 1 ... b = 2 ... c = calc_pow(a,b) ... """ >>> >>> _st = symtable.symtable(code, "example.py", "exec") >>> _st.get_identifiers() dict_keys(['calc_pow', 'a', 'b', 'c']) >>> _st.get_identifiers().mapping mappingproxy({'calc_pow': 2066, 'a': 2066, 'b': 2066, 'c': 2050})