mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +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
|
@ -971,6 +971,7 @@ A class object can be called (see above) to yield a class instance (see below).
|
|||
single: __annotations__ (class attribute)
|
||||
single: __type_params__ (class attribute)
|
||||
single: __static_attributes__ (class attribute)
|
||||
single: __firstlineno__ (class attribute)
|
||||
|
||||
Special attributes:
|
||||
|
||||
|
@ -1005,6 +1006,9 @@ Special attributes:
|
|||
A tuple containing names of attributes of this class which are accessed
|
||||
through ``self.X`` from any function in its body.
|
||||
|
||||
:attr:`__firstlineno__`
|
||||
The line number of the first line of the class definition, including decorators.
|
||||
|
||||
|
||||
Class instances
|
||||
---------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue