Skip to content

traceback - fixed type hinting for locals_max_length & locals_max_string to support None#3822

Closed
talsaiag wants to merge 1 commit intoTextualize:masterfrom
talsaiag:patch-1
Closed

traceback - fixed type hinting for locals_max_length & locals_max_string to support None#3822
talsaiag wants to merge 1 commit intoTextualize:masterfrom
talsaiag:patch-1

Conversation

@talsaiag
Copy link
Copy Markdown

@talsaiag talsaiag commented Aug 7, 2025

Fixed type hinting for locals_max_length & locals_max_string to support None values (per the documentation)

Type of changes

  • Bug fix

Checklist

  • I've run the latest black with default args on new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Fixes this:

error: Argument "locals_max_length" to "from_exception" of "Traceback" has incompatible type "None"; expected "int"  [arg-type]
error: Argument "locals_max_length" to "RichHandler" has incompatible type "None"; expected "int"  [arg-type]

Fixed type hinting for locals_max_length & locals_max_string to support None values (per the documentation)
Copilot AI review requested due to automatic review settings August 7, 2025 11:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes type hinting inconsistencies for the locals_max_length and locals_max_string parameters in the traceback module. The parameters were documented to accept None values but were typed as int, causing type checker errors when None was passed.

  • Updated type annotations from int to Optional[int] for both parameters across multiple functions
  • Resolves mypy/type checker errors when passing None to these parameters

Comment thread rich/traceback.py
@talsaiag
Copy link
Copy Markdown
Author

stale for too long, already has conflicts...

@talsaiag talsaiag closed this Mar 25, 2026
@talsaiag talsaiag deleted the patch-1 branch March 25, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants