mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +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
|
@ -471,6 +471,7 @@ _code_type = type(_write_atomic.__code__)
|
|||
# Python 3.13a1 3567 (Reimplement line number propagation by the compiler)
|
||||
# Python 3.13a1 3568 (Change semantics of END_FOR)
|
||||
# Python 3.13a5 3569 (Specialize CONTAINS_OP)
|
||||
# Python 3.13a6 3570 (Add __firstlineno__ class attribute)
|
||||
|
||||
# Python 3.14 will start with 3600
|
||||
|
||||
|
@ -487,7 +488,7 @@ _code_type = type(_write_atomic.__code__)
|
|||
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
|
||||
# in PC/launcher.c must also be updated.
|
||||
|
||||
MAGIC_NUMBER = (3569).to_bytes(2, 'little') + b'\r\n'
|
||||
MAGIC_NUMBER = (3570).to_bytes(2, 'little') + b'\r\n'
|
||||
|
||||
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue