summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGabriele N. Tornetta <P403n1x87@users.noreply.github.com>2021-07-07 11:21:51 (GMT)
committerGitHub <noreply@github.com>2021-07-07 11:21:51 (GMT)
commit2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f (patch)
tree446776f951c764ef32fbe91e80c7928be0fe54b4 /Include
parent32096df0e00e692ee6dc688e62213bff0dffd573 (diff)
downloadcpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.zip
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.gz
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.bz2
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/code.h9
-rw-r--r--Include/internal/pycore_code.h1
2 files changed, 6 insertions, 4 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h
index f402be6..8c00eb9 100644
--- a/Include/cpython/code.h
+++ b/Include/cpython/code.h
@@ -75,6 +75,7 @@ struct PyCodeObject {
PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte per variable) */
PyObject *co_filename; /* unicode (where it was loaded from) */
PyObject *co_name; /* unicode (name, for reference) */
+ PyObject *co_qualname; /* unicode (qualname, for reference) */
PyObject *co_linetable; /* bytes (encoding addr<->lineno mapping) See
Objects/lnotab_notes.txt for details. */
PyObject *co_endlinetable; /* bytes object that holds end lineno for
@@ -154,14 +155,14 @@ PyAPI_DATA(PyTypeObject) PyCode_Type;
PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
- PyObject *, PyObject *, int, PyObject *, PyObject *,
- PyObject *, PyObject *);
+ PyObject *, PyObject *, PyObject *, int, PyObject *,
+ PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs(
int, int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
- PyObject *, PyObject *, int, PyObject *, PyObject *,
- PyObject *, PyObject *);
+ PyObject *, PyObject *, PyObject *, int, PyObject *,
+ PyObject *, PyObject *, PyObject *);
/* same as struct above */
/* Creates a new empty code object with the specified source location. */
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index 6c1f8e1..f5e814d 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -212,6 +212,7 @@ struct _PyCodeConstructor {
/* metadata */
PyObject *filename;
PyObject *name;
+ PyObject *qualname;
int flags;
/* the code */