gh-132775: Add _PyCode_GetXIData() (gh-133475)

This commit is contained in:
Eric Snow 2025-05-05 17:46:03 -06:00 committed by GitHub
parent e9616110aa
commit ea598730ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 116 additions and 6 deletions

View file

@ -687,6 +687,16 @@ class CodeTest(unittest.TestCase):
'checks': CO_FAST_LOCAL,
'res': CO_FAST_LOCAL,
},
defs.spam_args_attrs_and_builtins: {
'a': POSONLY,
'b': POSONLY,
'c': POSORKW,
'd': POSORKW,
'e': KWONLY,
'f': KWONLY,
'args': VARARGS,
'kwargs': VARKWARGS,
},
defs.spam_returns_arg: {
'x': POSORKW,
},
@ -697,6 +707,11 @@ class CodeTest(unittest.TestCase):
'x': CO_FAST_CELL,
'eggs': CO_FAST_LOCAL,
},
defs.spam_annotated: {
'a': POSORKW,
'b': POSORKW,
'c': POSORKW,
},
defs.spam_full: {
'a': POSONLY,
'b': POSONLY,
@ -892,6 +907,14 @@ class CodeTest(unittest.TestCase):
purelocals=5,
globalvars=6,
),
defs.spam_args_attrs_and_builtins: new_var_counts(
posonly=2,
posorkw=2,
kwonly=2,
varargs=1,
varkwargs=1,
attrs=1,
),
defs.spam_returns_arg: new_var_counts(
posorkw=1,
),
@ -902,6 +925,9 @@ class CodeTest(unittest.TestCase):
othercells=1,
purelocals=1,
),
defs.spam_annotated: new_var_counts(
posorkw=3,
),
defs.spam_full: new_var_counts(
posonly=2,
posorkw=2,