mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +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
|
@ -174,6 +174,11 @@ struct PyCodeObject _PyCode_DEF(1);
|
|||
|
||||
#define CO_NO_MONITORING_EVENTS 0x2000000
|
||||
|
||||
/* Whether the code object has a docstring,
|
||||
If so, it will be the first item in co_consts
|
||||
*/
|
||||
#define CO_HAS_DOCSTRING 0x4000000
|
||||
|
||||
/* This should be defined if a future statement modifies the syntax.
|
||||
For example, when a keyword is added.
|
||||
*/
|
||||
|
|
|
@ -123,6 +123,7 @@ typedef struct _symtable_entry {
|
|||
unsigned ste_comp_iter_target : 1; /* true if visiting comprehension target */
|
||||
unsigned ste_can_see_class_scope : 1; /* true if this block can see names bound in an
|
||||
enclosing class scope */
|
||||
unsigned ste_has_docstring : 1; /* true if docstring present */
|
||||
int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */
|
||||
_Py_SourceLocation ste_loc; /* source location of block */
|
||||
struct _symtable_entry *ste_annotation_block; /* symbol table entry for this entry's annotations */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue