◐ Shell
clean mode source ↗

Add `co_names` to `PyCode` by jopemachine · Pull Request #4177 · RustPython/RustPython

I updated the test_code.py, but there are some points that I'd like to mention.

  • Updated opcode.py for updating test_code.py. but I didn't update test_opcode.py because the test code is not changed.
  • There are some dump function calls in the above comment of the test_code.py. Because this raised test failure, I commented it out and added TODO: RUSTPYTHON comment on top of each function call.
  • I checked the added co_names manually in the dump calls, the first dump call's actual result is different from the expected result. The actual result is ('__doc__') while the expected result is empty tuple, the remaining test results are correct.
  • The updated opcode.py contains def_op('YIELD_FROM', 72) line which not exist in the cpython anymore. I included the line because it is used in coroutines.py. This needs to be removed after the coroutines.py file is updated.