mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-126072: do not add None
to co_consts
if there is no docstring (GH-126101)
This commit is contained in:
parent
2ab377a47c
commit
35df4eb959
16 changed files with 148 additions and 58 deletions
|
@ -1536,9 +1536,9 @@ Other bits in :attr:`~codeobject.co_flags` are reserved for internal use.
|
|||
|
||||
.. index:: single: documentation string
|
||||
|
||||
If a code object represents a function, the first item in
|
||||
:attr:`~codeobject.co_consts` is
|
||||
the documentation string of the function, or ``None`` if undefined.
|
||||
If a code object represents a function and has a docstring,
|
||||
the first item in :attr:`~codeobject.co_consts` is
|
||||
the docstring of the function.
|
||||
|
||||
Methods on code objects
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue