Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

gh-162602: Document int_max_str_digits limit for decimal integer literals - #162910

Open
Thishyaketh wants to merge 2 commits into
python:mainfrom
Thishyaketh:fix/gh-162602-int-literal-limit
Open

Thishyaketh wants to merge 2 commits into
python:mainfrom
Thishyaketh:fix/gh-162602-int-literal-limit

Conversation

@Thishyaketh

Copy link
Copy Markdown

Updates the Language Reference (Doc/reference/lexical_analysis.rst) to note that while Python has no language-level length limit for integer literals apart from available memory, CPython enforces the configured integer string conversion length limitation (int_max_str_digits) on decimal integer literals during parsing.

Summary

Verification

  • Verified that a 4,300-digit decimal literal compiles, a 4,301-digit decimal literal raises SyntaxError: Exceeds the limit (4300 digits) for integer string conversion, and 5,000-digit 0b, 0o, and 0x literals compile.

@python-cla-bot

python-cla-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #36285267 | 📁 Comparing de31e71 against main (44c154a)

  🔍 Preview build  

1 file changed
± reference/lexical_analysis.html

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant