Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
Lazily import traceback in logging #150072
Copy link
Copy link
Open
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-lazy-importstype-featureA feature request or enhancementA feature request or enhancement
Description
Metadata
Metadata
Assignees
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-lazy-importstype-featureA feature request or enhancementA feature request or enhancement
Projects
StatusShow more project fields
No status
Feature or enhancement
Proposal:
Currently,
Lib/logging/__init__.pyandLib/logging/config.pyeagerly importtraceback, despite it only being used during exception handling. Making this import lazy avoids unnecessary startup overhead and improves initial loading time.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
traceback#150073