[issue36521] Consider removing docstrings from co_consts in code objects

Guido van Rossum report at bugs.python.org
Fri Sep 3 12:28:20 EDT 2021


Guido van Rossum <guido at python.org> added the comment:

I am still not convinced that it's a good idea to put the docstring in the surrounding code object. I'd like to be able to see it when I introspect a code object, not just when introspecting a function object (I may be analyzing code only, and it's hard to connect the code object with the NEW_FUNCTION opcode in the parent code object -- you have to scan the bytecode, which is fragile.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36521>
_______________________________________


More information about the Python-bugs-list mailing list