Skip to content

add ast.Num.n as alias for ast.Num.value for backwards compatibility. - #14355

Merged
srittau merged 2 commits into
python:mainfrom
hunterhogan:astNum
Jul 7, 2025
Merged

srittau merged 2 commits into
python:mainfrom
hunterhogan:astNum

Conversation

@hunterhogan

Copy link
Copy Markdown
Contributor
(.venv) C:\apps\astToolFactory>py
Python 3.13.5 (tags/v3.13.5:6cb20a2, Jun 11 2025, 16:15:46) [MSC v.1943 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast, warnings; warnings.filterwarnings("ignore")
>>> ast.Constant._fields
('value', 'kind')
>>> ast.Constant._field_types
{'value': <class 'object'>, 'kind': str | None}
>>> ast.Num.__base__
<class 'ast.Constant'>
>>> ast.Num._fields
('n',)
>>> ast.Num._field_types
{'value': <class 'object'>, 'kind': str | None}
>>>

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 5, 2025

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit 4c3560d into python:main Jul 7, 2025
@hunterhogan
hunterhogan deleted the astNum branch July 7, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants