Skip to content

Commit 6add7fe

Browse files
committed
Add new "tp_watched" PyTypeObject field in Py3.12.
See python/cpython#97875
1 parent 9d38bf8 commit 6add7fe

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

Cython/Compiler/TypeSlots.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ def __init__(self, old_binops):
10911091
used_ifdef="CYTHON_USE_TP_FINALIZE"),
10921092
EmptySlot("tp_vectorcall", ifdef="PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)"),
10931093
EmptySlot("tp_print", ifdef="PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000"),
1094+
EmptySlot("tp_watched", ifdef="PY_VERSION_HEX >= 0x030C0000"),
10941095
# PyPy specific extension - only here to avoid C compiler warnings.
10951096
EmptySlot("tp_pypy_flags", ifdef="CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000"),
10961097
)

Cython/Utility/AsyncGen.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@ static PyTypeObject __pyx_AsyncGenType_type = {
466466
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
467467
0, /*tp_print*/
468468
#endif
469+
#if PY_VERSION_HEX >= 0x030C0000
470+
0, /*tp_watched*/
471+
#endif
469472
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
470473
0, /*tp_pypy_flags*/
471474
#endif
@@ -738,6 +741,9 @@ static PyTypeObject __pyx__PyAsyncGenASendType_type = {
738741
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
739742
0, /*tp_print*/
740743
#endif
744+
#if PY_VERSION_HEX >= 0x030C0000
745+
0, /*tp_watched*/
746+
#endif
741747
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
742748
0, /*tp_pypy_flags*/
743749
#endif
@@ -873,6 +879,9 @@ static PyTypeObject __pyx__PyAsyncGenWrappedValueType_type = {
873879
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
874880
0, /*tp_print*/
875881
#endif
882+
#if PY_VERSION_HEX >= 0x030C0000
883+
0, /*tp_watched*/
884+
#endif
876885
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
877886
0, /*tp_pypy_flags*/
878887
#endif
@@ -1214,6 +1223,9 @@ static PyTypeObject __pyx__PyAsyncGenAThrowType_type = {
12141223
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12151224
0, /*tp_print*/
12161225
#endif
1226+
#if PY_VERSION_HEX >= 0x030C0000
1227+
0, /*tp_watched*/
1228+
#endif
12171229
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
12181230
0, /*tp_pypy_flags*/
12191231
#endif

Cython/Utility/Coroutine.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,9 @@ static PyTypeObject __pyx_CoroutineAwaitType_type = {
16621662
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16631663
0, /*tp_print*/
16641664
#endif
1665+
#if PY_VERSION_HEX >= 0x030C0000
1666+
0, /*tp_watched*/
1667+
#endif
16651668
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
16661669
0, /*tp_pypy_flags*/
16671670
#endif
@@ -1854,6 +1857,9 @@ static PyTypeObject __pyx_CoroutineType_type = {
18541857
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18551858
0, /*tp_print*/
18561859
#endif
1860+
#if PY_VERSION_HEX >= 0x030C0000
1861+
0, /*tp_watched*/
1862+
#endif
18571863
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18581864
0, /*tp_pypy_flags*/
18591865
#endif
@@ -2004,6 +2010,9 @@ static PyTypeObject __pyx_IterableCoroutineType_type = {
20042010
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20052011
0, /*tp_print*/
20062012
#endif
2013+
#if PY_VERSION_HEX >= 0x030C0000
2014+
0, /*tp_watched*/
2015+
#endif
20072016
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20082017
0, /*tp_pypy_flags*/
20092018
#endif
@@ -2150,6 +2159,9 @@ static PyTypeObject __pyx_GeneratorType_type = {
21502159
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21512160
0, /*tp_print*/
21522161
#endif
2162+
#if PY_VERSION_HEX >= 0x030C0000
2163+
0, /*tp_watched*/
2164+
#endif
21532165
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21542166
0, /*tp_pypy_flags*/
21552167
#endif

Cython/Utility/CythonFunction.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@ static PyTypeObject __pyx_CyFunctionType_type = {
10521052
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
10531053
0, /*tp_print*/
10541054
#endif
1055+
#if PY_VERSION_HEX >= 0x030C0000
1056+
0, /*tp_watched*/
1057+
#endif
10551058
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
10561059
0, /*tp_pypy_flags*/
10571060
#endif
@@ -1580,6 +1583,9 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
15801583
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
15811584
0, /*tp_print*/
15821585
#endif
1586+
#if PY_VERSION_HEX >= 0x030C0000
1587+
0, /*tp_watched*/
1588+
#endif
15831589
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
15841590
0, /*tp_pypy_flags*/
15851591
#endif

0 commit comments

Comments
 (0)