when it shouldn't. I was able to repro this in cases where a nested function is defined, i.e: ```python def foo(): def inner(): pass ``` In RustPython: ```python >>>>> foo.__code__.co_names ('__doc__',) ``` while in Python: ```python >>> foo.__code__.co_names () ``` and also when compiling a module from a source string: ```python stmts = """ import blah def foo(): pass """ code = compile(stmts, "<test>", "exec") ``` In RustPython: ```python >>>>> code.co_names ('blah', '__doc__', 'foo') ``` while in Python: ```python >>> code.co_names ('blah', 'foo') ``` not entirely sure how easy the fix might be.