mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-118465: Add __firstlineno__ attribute to class (GH-118475)
It is set by compiler with the line number of the first line of the class definition.
This commit is contained in:
parent
716ec4bfcf
commit
153b3f7530
17 changed files with 61 additions and 89 deletions
|
|
@ -624,6 +624,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__eq__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__exit__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__file__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__firstlineno__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__float__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__floordiv__));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(__format__));
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(__eq__)
|
||||
STRUCT_FOR_ID(__exit__)
|
||||
STRUCT_FOR_ID(__file__)
|
||||
STRUCT_FOR_ID(__firstlineno__)
|
||||
STRUCT_FOR_ID(__float__)
|
||||
STRUCT_FOR_ID(__floordiv__)
|
||||
STRUCT_FOR_ID(__format__)
|
||||
|
|
|
|||
1
Include/internal/pycore_runtime_init_generated.h
generated
1
Include/internal/pycore_runtime_init_generated.h
generated
|
|
@ -622,6 +622,7 @@ extern "C" {
|
|||
INIT_ID(__eq__), \
|
||||
INIT_ID(__exit__), \
|
||||
INIT_ID(__file__), \
|
||||
INIT_ID(__firstlineno__), \
|
||||
INIT_ID(__float__), \
|
||||
INIT_ID(__floordiv__), \
|
||||
INIT_ID(__format__), \
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
|
|||
string = &_Py_ID(__file__);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(__firstlineno__);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(__float__);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue