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-76785: Handle Legacy Interpreters Properly by ericsnowcurrently · Pull Request #117490 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Apr 2, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This is similar to the situation with threading._DummyThread. The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create(). The simplest thing is to disable any method that modifies or runs in the interpreter. As part of this, the runtime keeps track of where an interpreter was created. We also handle interpreter "refcounts" properly.

  • Issue: [subinterpreters] PEP 554 implementation: add interpreters module #76785

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 2, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Apr 2, 2024
[subinterpreters] PEP 554 implementation: add interpreters module #76785
Closed
@ericsnowcurrently
ericsnowcurrently force-pushed the hide-legacy-subinterpreters branch 4 times, most recently from 1e32031 to dcf6e8c Compare April 9, 2024 20:53
@ericsnowcurrently
ericsnowcurrently force-pushed the hide-legacy-subinterpreters branch from dcf6e8c to 7de833a Compare April 10, 2024 23:39
ericsnowcurrently added 17 commits April 10, 2024 18:37
@ericsnowcurrently
Identify unmanaged interpreters.
5b68f4d
@ericsnowcurrently
Implement using a hashtable.
1811e50
@ericsnowcurrently
Call drop_owned() after Py_EndInterpreter(), not before.
05a3923
@ericsnowcurrently
Use a linked list.
6f7c83d
@ericsnowcurrently
Add restrictions.
3a60142
@ericsnowcurrently
Hide unmanaged interpreters.
98fc876
@ericsnowcurrently
Use Interpreter for unmanaged interpreters.
c2629b7
@ericsnowcurrently
Fix other tests.
f1e2461
@ericsnowcurrently
Default to require_owned=False.
55a1c31
@ericsnowcurrently
Interpreter.owned -> Interpreter.whence
f73b6f3
@ericsnowcurrently
require_owned -> restrict
7e6432c
@ericsnowcurrently
Add PyInterpreterState._whence.
19b68eb
@ericsnowcurrently
Drop the module's global state.
d713ecf
@ericsnowcurrently
Drop a duplicate module func def.
fe362d1
@ericsnowcurrently
Require the interpreter to be ready for most operations.
cd7d5ee
@ericsnowcurrently
Do not expose not-ready interpreters in the high-level module.
4f92794
@ericsnowcurrently
Fix destroying a not-ready interpreter.
e38f141
@ericsnowcurrently
ericsnowcurrently force-pushed the hide-legacy-subinterpreters branch from 7de833a to e38f141 Compare April 11, 2024 00:40
@ericsnowcurrently
ericsnowcurrently marked this pull request as ready for review April 11, 2024 20:40
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 11, 2024
ericsnowcurrently added 2 commits April 11, 2024 16:54
@ericsnowcurrently
Hide a variable on non-debug builds.
2274d6e
@ericsnowcurrently
Merge branch 'main' into hide-legacy-subinterpreters
c796cfa
@ericsnowcurrently
ericsnowcurrently enabled auto-merge (squash) April 11, 2024 22:59
@ericsnowcurrently
ericsnowcurrently merged commit fd259fd into python:main Apr 11, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 11, 2024
@ericsnowcurrently
ericsnowcurrently deleted the hide-legacy-subinterpreters branch April 11, 2024 23:26
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@ericsnowcurrently @diegorusso
pythongh-76785: Handle Legacy Interpreters Properly (pythongh-117490)
f787e35
This is similar to the situation with threading._DummyThread.  The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create().  The simplest thing to start with is to disable any method that modifies or runs in the interpreter.  As part of this, the runtime keeps track of where an interpreter was created.  We also handle interpreter "refcounts" properly.
This was referenced Aug 11, 2025
GH-137630: Convert _interpreters to use Argument Clinic #137631
Merged
_interpreters annotations are outdated python/typeshed#14588
Closed
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.

1 participant

@ericsnowcurrently
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 01402503 — 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.