Opening this separately from #1838 since it also seems like a good first issue. Currently, code objects are missing the `co_freevars` attribute: ```python def foo(a, b, c): pass ``` In RustPython: ```python >>>>> foo.__code__.co_nlocals AttributeError: 'code' object has no attribute 'co_nlocals' ``` While in Python: ```python >>> foo.__code__.co_nlocals 3 ``` looking at the other methods on [`PyCode`](https://github.com/RustPython/RustPython/blob/1fd557d549cd72e7da83608b99e5464273abd4b3/vm/src/builtins/code.rs#L188) 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](https://github.com/python/cpython/blob/3ba7743b0696202e9caa283a0be253fd26a5cfbd/Objects/codeobject.c#L676) in the CPython source)
Activity
Add co_nlocals to code object