Skip to content

perf: remove dead logging import from segment.py#3

Closed
KRRT7 wants to merge 1 commit intomasterfrom
perf/dead-logging-segment
Closed

perf: remove dead logging import from segment.py#3
KRRT7 wants to merge 1 commit intomasterfrom
perf/dead-logging-segment

Conversation

@KRRT7
Copy link
Copy Markdown
Owner

@KRRT7 KRRT7 commented Apr 9, 2026

Summary

Remove unused from logging import getLogger and log = getLogger("rich") from segment.py. The log variable is never referenced anywhere in the file.

Avoids importing the logging module (and its transitive chain: traceback, linecache, tokenize) on the Console import path when logging hasn't been imported by other means.

Testing

952 passed on CPython 3.9–3.14 and PyPy 3.10.

`getLogger("rich")` was imported and assigned to `log` but never used
anywhere in segment.py. Removing it avoids importing the `logging`
module (and its transitive chain: traceback, linecache, tokenize)
on the Console import path.
@KRRT7
Copy link
Copy Markdown
Owner Author

KRRT7 commented Apr 9, 2026

Superseded by the consolidated stacked PRs #12 + #13.

@KRRT7 KRRT7 closed this Apr 9, 2026
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