]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-145239: Accept unary plus literal pattern (#148566)
authorBartosz Sławecki <bartosz@ilikepython.com>
Thu, 23 Apr 2026 19:07:28 +0000 (21:07 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2026 19:07:28 +0000 (22:07 +0300)
commit448d7b96c181d13ca7f8977780e85b53b2716294
treefae89762e29b368281290018cb6bcb3080e5338c
parent4629c2215a9a4b3d1ec4a306cd4dd7d11dcfebb4
gh-145239: Accept unary plus literal pattern (#148566)

Add '+' alternatives to signed_number and signed_real_number grammar
rules, mirroring how unary minus is already handled for pattern matching.
Unary plus is a no-op on numbers so the value is returned directly without
wrapping in a UnaryOp node.
Doc/reference/compound_stmts.rst
Doc/whatsnew/3.15.rst
Grammar/python.gram
Lib/test/.ruff.toml
Lib/test/test_patma.py
Misc/NEWS.d/next/Core_and_Builtins/2026-04-13-23-21-45.gh-issue-145239.pL8qRt.rst [new file with mode: 0644]
Parser/parser.c