GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-118761: Fix star-import of ``ast`` by AA-Turner · Pull Request #132024 · python/cpython

Conversation

@AA-Turner

@AA-Turner AA-Turner commented Apr 2, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

cc @danielhollas

I agree that removing 'sys' in __dir__ is fragile, but we can now move the import to the main() function, which I missed initially.

A

  • Issue: Improve import time of various stdlib modules #118761

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AA-Turner added 2 commits April 2, 2025 18:22
@AA-Turner
pythongh-118761: Fix star-import of ast
165ecc9
@AA-Turner
Make sys import local
6c3ddda
@AA-Turner
AA-Turner requested review from Eclips4, JelleZijlstra and isidentical as code owners April 2, 2025 17:26
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 2, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Apr 2, 2025
Improve import time of various stdlib modules #118761
Closed
@AA-Turner AA-Turner mentioned this pull request Apr 2, 2025
gh-118761: Optimise import time for ast #131953
Merged
@AA-Turner AA-Turner added the skip news label Apr 2, 2025
@JelleZijlstra JelleZijlstra mentioned this pull request Apr 2, 2025
gh-118761: Fix star-import of ast (alternative) #132025
Merged
@danielhollas

danielhollas commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

I agree that removing 'sys' in dir is fragile, but we can now move the import to the main() function, which I missed initially.

Thanks, but my original objection still stands: If somebody introduces a new import at the top of the file and "forgets" to modify __dir__ we have a problem. And that problem would be worse in this PR which explicitly couples __dir__ to star imports.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Apr 2, 2025

Copy link
Copy Markdown
Member Author

Closing in favour of #132025.

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner closed this Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@isidentical isidentical Awaiting requested review from isidentical isidentical is a code owner
@JelleZijlstra JelleZijlstra Awaiting requested review from JelleZijlstra JelleZijlstra is a code owner
@Eclips4 Eclips4 Awaiting requested review from Eclips4 Eclips4 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@AA-Turner @danielhollas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.