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-117953: Let update_global_state_for_extension() Caller Decide If Singlephase or Not by ericsnowcurrently · Pull Request #118193 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Apr 23, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This change makes other upcoming changes simpler.

  • Issue: Single-Phase Init Extension Module Init Functions Still Run in Isolated Interpreters #117953

Sorry, something went wrong.

Uh oh!

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

All reactions
@ericsnowcurrently ericsnowcurrently added the skip news label Apr 23, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Apr 23, 2024
Single-Phase Init Extension Module Init Functions Still Run in Isolated Interpreters #117953
Closed
@ericsnowcurrently
ericsnowcurrently force-pushed the caller-decides-singlephase-for-update_global_state_for_extension branch from 2a91353 to 81daac5 Compare April 23, 2024 18:45
@ericsnowcurrently ericsnowcurrently changed the title gh-117953: Let update_global_state_for_extension() Caller Decides Singlephase or Not gh-117953: Let update_global_state_for_extension() Caller Decide If Singlephase or Not Apr 23, 2024
@ericsnowcurrently
Let the caller of update_extensions_cache() decide if m_copy should b…
fe993a0
…e populated.
@ericsnowcurrently
ericsnowcurrently force-pushed the caller-decides-singlephase-for-update_global_state_for_extension branch from 81daac5 to fe993a0 Compare April 24, 2024 15:58
@ericsnowcurrently
ericsnowcurrently marked this pull request as ready for review April 24, 2024 15:58
@ericsnowcurrently
ericsnowcurrently requested a review from kumaraditya303 as a code owner April 24, 2024 15:58
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 24, 2024
@ericsnowcurrently
ericsnowcurrently removed the request for review from kumaraditya303 April 24, 2024 15:58
@ericsnowcurrently
ericsnowcurrently enabled auto-merge (squash) April 24, 2024 16:01
@ericsnowcurrently
ericsnowcurrently merged commit 1acd249 into python:main Apr 24, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 24, 2024
@ericsnowcurrently
ericsnowcurrently deleted the caller-decides-singlephase-for-update_global_state_for_extension branch April 24, 2024 16:36
@encukou

encukou commented Apr 26, 2024

Copy link
Copy Markdown
Member

AFAIK, the idea back then was that single/multiple phase should be determined by the return type from the init function, not by the existence of slots; NULL slots would be equivalent to zero slots (a multi-phase module that doesn't need custom initialization).

I see that multiphase with m_slots=NULL isn't tested explicitly, though.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou encukou mentioned this pull request Apr 26, 2024
gh-117953: Split Up _PyImport_LoadDynamicModuleWithSpec() #118203
Merged
@ericsnowcurrently

ericsnowcurrently commented Apr 26, 2024

Copy link
Copy Markdown
Member Author

Thanks for bringing this up. What you've said makes sense and appreciate the clarity of it. There are indeed some gaps (fairly small, I expect), both functionally and in tests. It isn't clear what the impact is in practice, but I definitely think they should be addressed regardless. I'll be sure to open some issues in the next week or two.

FWIW, the general thought of kinds of extension modules was already on my mind (and a bit clearer in my original mega-PR, gh-118116). For now I have a later PR (gh-118205) that is a bit more deliberate about keeping track of what the init function returns. While that PR doesn't do so currently, I might look at explicitly tracking the kind on the module def. That would help address the point you've brought up.

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou

encukou commented Apr 29, 2024

Copy link
Copy Markdown
Member

Thanks! Following up here: #117953 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

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

@ericsnowcurrently @encukou
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.