cpython/Doc/whatsnew
Jelle Zijlstra ed4dfd8825
gh-105858: Improve AST node constructors (#105880)
Demonstration:

>>> ast.FunctionDef.__annotations__
{'name': <class 'str'>, 'args': <class 'ast.arguments'>, 'body': list[ast.stmt], 'decorator_list': list[ast.expr], 'returns': ast.expr | None, 'type_comment': str | None, 'type_params': list[ast.type_param]}
>>> ast.FunctionDef()
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'name'. This will become an error in Python 3.15.
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'args'. This will become an error in Python 3.15.
<ast.FunctionDef object at 0x101959460>
>>> node = ast.FunctionDef(name="foo", args=ast.arguments())
>>> node.decorator_list
[]
>>> ast.FunctionDef(whatever="you want", name="x", args=ast.arguments())
<stdin>:1: DeprecationWarning: FunctionDef.__init__ got an unexpected keyword argument 'whatever'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
<ast.FunctionDef object at 0x1019581f0>
2024-02-27 18:13:03 -08:00
..
2.0.rst gh-101100: Fix Sphinx warnings in `whatsnew/2.0.rst` (#112351) 2024-02-25 02:45:56 -07:00
2.1.rst gh-101100: Fix Sphinx warnings in `whatsnew/2.1.rst` (#112357) 2024-02-25 23:49:04 -07:00
2.2.rst gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327) 2024-02-04 09:45:35 +00:00
2.3.rst gh-113664: Improve style of Big O notation (GH-113695) 2024-01-10 15:01:18 +02:00
2.4.rst gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327) 2024-02-04 09:45:35 +00:00
2.5.rst gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327) 2024-02-04 09:45:35 +00:00
2.6.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
2.7.rst gh-101100: Fix Sphinx warnings in `whatsnew/2.7.rst` and related (#115319) 2024-02-12 14:40:41 +02:00
3.0.rst gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327) 2024-02-04 09:45:35 +00:00
3.1.rst gh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (#115575) 2024-02-17 02:39:07 -07:00
3.2.rst gh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (#115580) 2024-02-17 03:03:20 -07:00
3.3.rst gh-113664: Improve style of Big O notation (GH-113695) 2024-01-10 15:01:18 +02:00
3.4.rst gh-101100: Fix Sphinx warnings for removed dead batteries (#113669) 2024-01-03 13:04:26 +00:00
3.5.rst gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327) 2024-02-04 09:45:35 +00:00
3.6.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.7.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.8.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.9.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.10.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.11.rst gh-100734: Add 'Notable change in 3.11.x' to `whatsnew/3.11.rst` (#114657) 2024-01-28 20:28:25 +00:00
3.12.rst gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689) 2024-02-15 17:32:33 +02:00
3.13.rst gh-105858: Improve AST node constructors (#105880) 2024-02-27 18:13:03 -08:00
changelog.rst Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:46:18 -07:00
index.rst Fix whatsnew for 3.13. (GH-104756) 2023-05-22 16:05:27 -04:00