Skip to content

fix(traceback): fix type-hints for locals_max_{length|string}#3630

Open
ruancomelli wants to merge 5 commits into
Textualize:mainfrom
ruancomelli:fix/rich/traceback/fix-type-hints-for-locals-max-length-and-string
Open

fix(traceback): fix type-hints for locals_max_{length|string}#3630
ruancomelli wants to merge 5 commits into
Textualize:mainfrom
ruancomelli:fix/rich/traceback/fix-type-hints-for-locals-max-length-and-string

Conversation

@ruancomelli

@ruancomelli ruancomelli commented Feb 10, 2025

Copy link
Copy Markdown

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pydantic in the code review.

Description

The documentation of parameters locals_max_length and locals_max_string states that they can be None, in which case no maximum is applied:

locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10.
locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80.

This PR fixes the corresponding type-hints to allow None by replacing int with Optional[int].

The documentation of parameters `locals_max_length`
and `locals_max_string` states that they can be
`None`, in which case no maximum is applied.
This commit fixes the corresponding type-hints
to allow `None` by replacing `int` with
`Optional[int]`.
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.

1 participant