summaryrefslogtreecommitdiffstats
path: root/Python/crossinterp_data_lookup.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135491)Eric Snow2025-06-161-7/+17
| | | | | | | | | | | | | | | | | For several builtin functions, we now fall back to __main__.__dict__ for the globals when there is no current frame and _PyInterpreterState_IsRunningMain() returns true. This allows those functions to be run with Interpreter.call(). The affected builtins: * exec() * eval() * globals() * locals() * vars() * dir() We take a similar approach with "stateless" functions, which don't use any global variables.
* gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)Eric Snow2025-06-131-0/+27
| | | | | | | | | | In this refactor we: * move some code around * make a couple of typedefs opaque * decouple errors from session state * improve tracebacks for propagated exceptions This change helps simplify several upcoming changes.
* gh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134758)Eric Snow2025-05-271-0/+8
| | | | | This is a small follow-up to gh-133481. There's a corner case in the behavior of PyImport_ImportModuleAttrString(), where it expects __builtins__ to be set if __globals__ is set.
* gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)Eric Snow2025-05-211-24/+38
| | | It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`. There's also room for other fallback modes if that later makes sense.
* gh-132775: Add _PyFunction_GetXIData() (gh-133481)Eric Snow2025-05-121-0/+56
|
* gh-132775: Add _PyCode_GetXIData() (gh-133475)Eric Snow2025-05-051-0/+24
|
* gh-132775: Add _PyBytes_GetXIData() (gh-133101)Eric Snow2025-04-281-13/+75
| | | This is the base for several other XIData wrappers, like pickle and marshal. It is essentially a refactor of the existing bytes XIData code.
* gh-132775: Cleanup Related to crossinterp.c Before Further Changes (gh-132974)Eric Snow2025-04-281-50/+50
| | | This change consists of adding tests and moving code around, with some renaming thrown in.
* gh-132781: Cleanup Code Related to NotShareableError (gh-132782)Eric Snow2025-04-251-31/+66
| | | | | | | | | | The following are added to the internal C-API: * _PyErr_FormatV() * _PyErr_SetModuleNotFoundError() * _PyXIData_GetNotShareableErrorType() * _PyXIData_FormatNotShareableError() We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().
* gh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960)Eric Snow2025-04-251-2/+0
| | | This is a partial revert of gh-132821. It resolves the refleak introduced by that PR.
* gh-132776: Cleanup for XIBufferViewType (gh-132821)Eric Snow2025-04-251-0/+2
| | | | | * add notes * rename XIBufferViewObject to xibufferview * move memoryview XIData code to memoryobject.c
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707)Eric Snow2024-11-121-31/+44
| | | | | | | | | These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12. This involves the following: * add the _PyXI_GET_STATE() and _PyXI_GET_GLOBAL_STATE() macros * add _PyXIData_lookup_context_t and _PyXIData_GetLookupContext() * add _Py_xi_state_init() and _Py_xi_state_fini()
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (1/2) (gh-126704)Eric Snow2024-11-111-2/+2
| | | | | | | | | These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12. This involves the following: * rename several structs and typedefs * add several typedefs * stop using the PyThreadState.state field directly in parking_lot.c
* gh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)Eric Snow2024-11-071-107/+99
| | | | | | | | The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around. * CrossInterpreterData -> XIData * crossinterpdatafunc -> xidatafunc * split out pycore_crossinterp_data_registry.h * add _PyXIData_lookup_t
* gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)Eric Snow2024-02-131-0/+594
For the most part, these changes make is substantially easier to backport subinterpreter-related code to 3.12, especially the related modules (e.g. _xxsubinterpreters). The main motivation is to support releasing a PyPI package with the 3.13 capabilities compiled for 3.12. A lot of the changes here involve either hiding details behind macros/functions or splitting up some files.