Skip to content

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

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
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [13.9.5] - 2025-02-10

### Fixed

- Fixed type-hints for `locals_max_length` and `locals_max_string` in `Traceback` https://github.com/Textualize/rich/pull/3630

## [13.9.4] - 2024-11-01

### Changed
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The following people have contributed to the development of Rich:
- [Dennis Brakhane](https://github.com/brakhane)
- [Darren Burns](https://github.com/darrenburns)
- [Ceyda Cinarel](https://github.com/cceyda)
- [Ruan Cardoso Comelli](https://github.com/ruancomelli)
- [Jim Crist-Harif](https://github.com/jcrist)
- [Ed Davis](https://github.com/davised)
- [Pete Davison](https://github.com/pd93)
Expand Down
16 changes: 8 additions & 8 deletions rich/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def install(
theme: Optional[str] = None,
word_wrap: bool = False,
show_locals: bool = False,
locals_max_length: int = LOCALS_MAX_LENGTH,
locals_max_string: int = LOCALS_MAX_STRING,
locals_max_length: Optional[int] = LOCALS_MAX_LENGTH,
locals_max_string: Optional[int] = LOCALS_MAX_STRING,
locals_hide_dunder: bool = True,
locals_hide_sunder: Optional[bool] = None,
indent_guides: bool = True,
Expand Down Expand Up @@ -252,8 +252,8 @@ def __init__(
theme: Optional[str] = None,
word_wrap: bool = False,
show_locals: bool = False,
locals_max_length: int = LOCALS_MAX_LENGTH,
locals_max_string: int = LOCALS_MAX_STRING,
locals_max_length: Optional[int] = LOCALS_MAX_LENGTH,
locals_max_string: Optional[int] = LOCALS_MAX_STRING,
locals_hide_dunder: bool = True,
locals_hide_sunder: bool = False,
indent_guides: bool = True,
Expand Down Expand Up @@ -308,8 +308,8 @@ def from_exception(
theme: Optional[str] = None,
word_wrap: bool = False,
show_locals: bool = False,
locals_max_length: int = LOCALS_MAX_LENGTH,
locals_max_string: int = LOCALS_MAX_STRING,
locals_max_length: Optional[int] = LOCALS_MAX_LENGTH,
locals_max_string: Optional[int] = LOCALS_MAX_STRING,
locals_hide_dunder: bool = True,
locals_hide_sunder: bool = False,
indent_guides: bool = True,
Expand Down Expand Up @@ -376,8 +376,8 @@ def extract(
traceback: Optional[TracebackType],
*,
show_locals: bool = False,
locals_max_length: int = LOCALS_MAX_LENGTH,
locals_max_string: int = LOCALS_MAX_STRING,
locals_max_length: Optional[int] = LOCALS_MAX_LENGTH,
locals_max_string: Optional[int] = LOCALS_MAX_STRING,
locals_hide_dunder: bool = True,
locals_hide_sunder: bool = False,
) -> Trace:
Expand Down