Skip to content

IDLE: Handle repr(big_integer) value error #135498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
terryjreedy opened this issue Jun 14, 2025 · 0 comments
Open

IDLE: Handle repr(big_integer) value error #135498

terryjreedy opened this issue Jun 14, 2025 · 0 comments
Assignees
Labels
stdlib Python modules in the Lib dir topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

(Spinoff of #135487.) In Shell

>>> 1<<15000
Traceback (most recent call last):
  File "<pyshell#38>", line 1, in <module>
    1<<15000
ValueError: Exceeds the limit (4300 digits) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit

The error also occurs in Debugger. For debugger, I have already thought replacing reprlib.repr since debugger displays only about the first 40 chars of the repr string. First possibility: f"int(10**{log10(n)})". It returns a legal expression, but large-enough exponents overflow. Second: f"10**round({log10(n)}) # Approximately. This will evaluate to an order of magnitude approximation, which is often better than 100s or 1000s of digits. In Shell, the error message could follow as a comment. In debugger, I would like to add hovertips with more information.

@terryjreedy terryjreedy self-assigned this Jun 14, 2025
@picnixz picnixz added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

No branches or pull requests

2 participants