Skip to content

gh-149277: Fix error position for invalid numeric literals - #155534

Open
skirpichev wants to merge 8 commits into
python:mainfrom
skirpichev:better-lit-errors/149277
Open

gh-149277: Fix error position for invalid numeric literals#155534
skirpichev wants to merge 8 commits into
python:mainfrom
skirpichev:better-lit-errors/149277

Conversation

@skirpichev

@skirpichev skirpichev commented Aug 11, 2026

Copy link
Copy Markdown
Member

# Errors thrown by the tokenizer
check('(0x+1)', 1, 3)
check('x = 0xI', 1, 6)
check('(0x+1)', 1, 4)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exponent-sign and underscore branches still back up before reporting the error. Can we update those too, or narrow the NEWS wording?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch. I hope now news entry is correct.

Comment thread Lib/test/test_exceptions.py Outdated
Comment thread Lib/test/test_grammar.py Outdated
@skirpichev
skirpichev requested a review from pablogsal September 8, 2026 04:44
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34443229 | 📁 Comparing 74e0063 against main (0b4c7da)

  🔍 Preview build  

1 file changed
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants