Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-117865: Defer import of re in ast#119546
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is used only by ast.get_source_segment(), so it seems sensible to avoid importing it.
How much does this speedup the import of |
(Though it's probably worth doing even if it just speeds up the import of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Locally for me this cuts about 20% off the import time forast
(0.0036s -> 0.0029s), so this seems worth doing. This is especially true since the_splitlines_no_ff
function is only ever used inget_source_segment
, which is one of the lesser-usedast
-module APIs
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
ae11d68
intopython:mainUh oh!
There was an error while loading.Please reload this page.
This is used only by ast.get_source_segment(), so it seems sensible to avoid importing it.Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Uh oh!
There was an error while loading.Please reload this page.