We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
co_nlocals
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
Opening this separately from #1838 since it also seems like a good first issue.
Currently, code objects are missing the co_freevars attribute:
co_freevars
def foo(a, b, c): pass
In RustPython:
>>>>> foo.__code__.co_nlocals AttributeError: 'code' object has no attribute 'co_nlocals'
While in Python:
>>> foo.__code__.co_nlocals 3
looking at the other methods on PyCode should help, the implementation should be similar to others there.
PyCode
As the linked issue states, this does indeed appear to be len(self.varnames) (see this invariant in the CPython source)
len(self.varnames)
The text was updated successfully, but these errors were encountered:
Add co_nlocals to code object
fea711c
Closes RustPython#4546
Successfully merging a pull request may close this issue.
Opening this separately from #1838 since it also seems like a good first issue.
Currently, code objects are missing the
co_freevars
attribute:In RustPython:
While in Python:
looking at the other methods on
PyCode
should help, the implementation should be similar to others there.As the linked issue states, this does indeed appear to be
len(self.varnames)
(see this invariant in the CPython source)The text was updated successfully, but these errors were encountered: