forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue_125038_get_iter_rework
- Loading branch information
Showing
49 changed files
with
1,216 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2230,7 +2230,7 @@ This is done by filling a :c:type:`PyType_Spec` structure and calling | |
.. _number-structs: | ||
|
||
Number Object Structures | ||
======================== | ||
------------------------ | ||
|
||
.. sectionauthor:: Amaury Forgeot d'Arc | ||
|
||
|
@@ -2344,7 +2344,7 @@ Number Object Structures | |
.. _mapping-structs: | ||
|
||
Mapping Object Structures | ||
========================= | ||
------------------------- | ||
|
||
.. sectionauthor:: Amaury Forgeot d'Arc | ||
|
||
|
@@ -2381,7 +2381,7 @@ Mapping Object Structures | |
.. _sequence-structs: | ||
|
||
Sequence Object Structures | ||
========================== | ||
-------------------------- | ||
|
||
.. sectionauthor:: Amaury Forgeot d'Arc | ||
|
||
|
@@ -2461,7 +2461,7 @@ Sequence Object Structures | |
.. _buffer-structs: | ||
|
||
Buffer Object Structures | ||
======================== | ||
------------------------ | ||
|
||
.. sectionauthor:: Greg J. Stein <[email protected]> | ||
.. sectionauthor:: Benjamin Peterson | ||
|
@@ -2556,7 +2556,7 @@ Buffer Object Structures | |
|
||
|
||
Async Object Structures | ||
======================= | ||
----------------------- | ||
|
||
.. sectionauthor:: Yury Selivanov <[email protected]> | ||
|
||
|
@@ -2624,7 +2624,7 @@ Async Object Structures | |
.. _slot-typedefs: | ||
|
||
Slot Type typedefs | ||
================== | ||
------------------ | ||
|
||
.. c:type:: PyObject *(*allocfunc)(PyTypeObject *cls, Py_ssize_t nitems) | ||
|
@@ -2733,7 +2733,7 @@ Slot Type typedefs | |
.. _typedef-examples: | ||
|
||
Examples | ||
======== | ||
-------- | ||
|
||
The following are simple examples of Python type definitions. They | ||
include common usage you may encounter. Some demonstrate tricky corner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef Py_CORE_CROSSINTERP_DATA_REGISTRY_H | ||
# error "this header must not be included directly" | ||
#endif | ||
|
||
|
||
// For now we use a global registry of shareable classes. An | ||
// alternative would be to add a tp_* slot for a class's | ||
// xidatafunc. It would be simpler and more efficient. | ||
|
||
struct _xidregitem; | ||
|
||
struct _xidregitem { | ||
struct _xidregitem *prev; | ||
struct _xidregitem *next; | ||
/* This can be a dangling pointer, but only if weakref is set. */ | ||
PyTypeObject *cls; | ||
/* This is NULL for builtin types. */ | ||
PyObject *weakref; | ||
size_t refcount; | ||
xidatafunc getdata; | ||
}; | ||
|
||
struct _xidregistry { | ||
int global; /* builtin types or heap types */ | ||
int initialized; | ||
PyMutex mutex; | ||
struct _xidregitem *head; | ||
}; | ||
|
||
PyAPI_FUNC(int) _PyXIData_RegisterClass(PyTypeObject *, xidatafunc); | ||
PyAPI_FUNC(int) _PyXIData_UnregisterClass(PyTypeObject *); | ||
|
||
struct _xid_lookup_state { | ||
// XXX Remove this field once we have a tp_* slot. | ||
struct _xidregistry registry; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.