fonttools 4.58.2__cp313-cp313-macosx_10_13_universal2.whl → 4.58.4__cp313-cp313-macosx_10_13_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fonttools might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.1.1 */
1
+ /* Generated by Cython 3.1.2 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -26,8 +26,8 @@ END: Cython Metadata */
26
26
  #elif PY_VERSION_HEX < 0x03080000
27
27
  #error Cython requires Python 3.8+.
28
28
  #else
29
- #define __PYX_ABI_VERSION "3_1_1"
30
- #define CYTHON_HEX_VERSION 0x030101F0
29
+ #define __PYX_ABI_VERSION "3_1_2"
30
+ #define CYTHON_HEX_VERSION 0x030102F0
31
31
  #define CYTHON_FUTURE_DIVISION 1
32
32
  /* CModulePreamble */
33
33
  #include <stddef.h>
@@ -442,7 +442,7 @@ END: Cython Metadata */
442
442
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
443
443
  #endif
444
444
  #ifndef CYTHON_NCP_UNUSED
445
- # if CYTHON_COMPILING_IN_CPYTHON
445
+ # if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
446
446
  # define CYTHON_NCP_UNUSED
447
447
  # else
448
448
  # define CYTHON_NCP_UNUSED CYTHON_UNUSED
@@ -887,11 +887,19 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
887
887
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
888
888
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
889
889
  #endif
890
- #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
890
+ #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
891
891
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
892
892
  #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
893
+ #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
894
+ #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
893
895
  #else
894
- #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i)
896
+ #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
897
+ #endif
898
+ #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
899
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
900
+ #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
901
+ #else
902
+ #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
895
903
  #endif
896
904
  #else
897
905
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
@@ -1299,7 +1307,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1299
1307
  #endif /* __GNUC__ */
1300
1308
  /* PretendToInitialize */
1301
1309
  #ifdef __cplusplus
1310
+ #if __cplusplus > 201103L
1302
1311
  #include <type_traits>
1312
+ #endif
1303
1313
  template <typename T>
1304
1314
  static void __Pyx_pretend_to_initialize(T* ptr) {
1305
1315
  #if __cplusplus > 201103L
@@ -1900,6 +1910,15 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
1900
1910
  /* CalculateMetaclass.proto */
1901
1911
  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1902
1912
 
1913
+ /* LimitedApiGetTypeDict.proto */
1914
+ #if CYTHON_COMPILING_IN_LIMITED_API
1915
+ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
1916
+ #endif
1917
+
1918
+ /* SetItemOnTypeDict.proto */
1919
+ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
1920
+ #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
1921
+
1903
1922
  /* FixUpExtensionType.proto */
1904
1923
  static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
1905
1924
 
@@ -1910,7 +1929,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void);
1910
1929
  static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);
1911
1930
 
1912
1931
  /* FetchCommonType.proto */
1913
- static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
1932
+ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
1933
+
1934
+ /* CommonTypesMetaclass.proto */
1935
+ static int __pyx_CommonTypesMetaclass_init(PyObject *module);
1936
+ #define __Pyx_CommonTypesMetaclass_USED
1914
1937
 
1915
1938
  /* CallTypeTraverse.proto */
1916
1939
  #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
@@ -2401,6 +2424,7 @@ static const char __pyx_k_momentXX[] = "momentXX";
2401
2424
  static const char __pyx_k_momentXY[] = "momentXY";
2402
2425
  static const char __pyx_k_momentYY[] = "momentYY";
2403
2426
  static const char __pyx_k_qualname[] = "__qualname__";
2427
+ static const char __pyx_k_set_name[] = "__set_name__";
2404
2428
  static const char __pyx_k_closePath[] = "_closePath";
2405
2429
  static const char __pyx_k_metaclass[] = "__metaclass__";
2406
2430
  static const char __pyx_k_A_T_3c_Q_1[] = "\200A\330\010\r\210T\320\021\"\240!\330\010\013\2103\210c\220\024\220Q\330\014\022\320\022\"\240!\2401";
@@ -2483,11 +2507,14 @@ typedef struct {
2483
2507
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
2484
2508
  PyObject *__pyx_tuple[2];
2485
2509
  PyObject *__pyx_codeobj_tab[7];
2486
- PyObject *__pyx_string_tab[200];
2510
+ PyObject *__pyx_string_tab[201];
2487
2511
  PyObject *__pyx_int_0;
2488
2512
  PyObject *__pyx_int_1;
2489
2513
  PyObject *__pyx_int_2;
2490
2514
  /* #### Code section: module_state_contents ### */
2515
+ /* CommonTypesMetaclass.module_state_decls */
2516
+ PyTypeObject *__pyx_CommonTypesMetaclassType;
2517
+
2491
2518
  /* CachedMethodType.module_state_decls */
2492
2519
  #if CYTHON_COMPILING_IN_LIMITED_API
2493
2520
  PyObject *__Pyx_CachedMethodType;
@@ -2709,18 +2736,19 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
2709
2736
  #define __pyx_n_u_r98 __pyx_string_tab[185]
2710
2737
  #define __pyx_n_u_r99 __pyx_string_tab[186]
2711
2738
  #define __pyx_n_u_self __pyx_string_tab[187]
2712
- #define __pyx_n_u_startPoint __pyx_string_tab[188]
2713
- #define __pyx_n_u_test __pyx_string_tab[189]
2714
- #define __pyx_n_u_x __pyx_string_tab[190]
2715
- #define __pyx_n_u_x0 __pyx_string_tab[191]
2716
- #define __pyx_n_u_x1 __pyx_string_tab[192]
2717
- #define __pyx_n_u_x2 __pyx_string_tab[193]
2718
- #define __pyx_n_u_x3 __pyx_string_tab[194]
2719
- #define __pyx_n_u_y __pyx_string_tab[195]
2720
- #define __pyx_n_u_y0 __pyx_string_tab[196]
2721
- #define __pyx_n_u_y1 __pyx_string_tab[197]
2722
- #define __pyx_n_u_y2 __pyx_string_tab[198]
2723
- #define __pyx_n_u_y3 __pyx_string_tab[199]
2739
+ #define __pyx_n_u_set_name __pyx_string_tab[188]
2740
+ #define __pyx_n_u_startPoint __pyx_string_tab[189]
2741
+ #define __pyx_n_u_test __pyx_string_tab[190]
2742
+ #define __pyx_n_u_x __pyx_string_tab[191]
2743
+ #define __pyx_n_u_x0 __pyx_string_tab[192]
2744
+ #define __pyx_n_u_x1 __pyx_string_tab[193]
2745
+ #define __pyx_n_u_x2 __pyx_string_tab[194]
2746
+ #define __pyx_n_u_x3 __pyx_string_tab[195]
2747
+ #define __pyx_n_u_y __pyx_string_tab[196]
2748
+ #define __pyx_n_u_y0 __pyx_string_tab[197]
2749
+ #define __pyx_n_u_y1 __pyx_string_tab[198]
2750
+ #define __pyx_n_u_y2 __pyx_string_tab[199]
2751
+ #define __pyx_n_u_y3 __pyx_string_tab[200]
2724
2752
  /* #### Code section: module_state_clear ### */
2725
2753
  #if CYTHON_USE_MODULE_STATE
2726
2754
  static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
@@ -2743,7 +2771,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
2743
2771
  #endif
2744
2772
  for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
2745
2773
  for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
2746
- for (int i=0; i<200; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
2774
+ for (int i=0; i<201; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
2747
2775
  Py_CLEAR(clear_module_state->__pyx_int_0);
2748
2776
  Py_CLEAR(clear_module_state->__pyx_int_1);
2749
2777
  Py_CLEAR(clear_module_state->__pyx_int_2);
@@ -2769,7 +2797,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
2769
2797
  #endif
2770
2798
  for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
2771
2799
  for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
2772
- for (int i=0; i<200; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
2800
+ for (int i=0; i<201; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
2773
2801
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
2774
2802
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
2775
2803
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_2);
@@ -7531,6 +7559,13 @@ __Pyx_RefNannySetupContext("PyInit_momentsPen", 0);
7531
7559
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7532
7560
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7533
7561
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
7562
+ /*--- Initialize various global constants etc. ---*/
7563
+ if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7564
+ stringtab_initialized = 1;
7565
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7566
+ #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED)
7567
+ if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7568
+ #endif
7534
7569
  #ifdef __Pyx_CyFunction_USED
7535
7570
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7536
7571
  #endif
@@ -7547,10 +7582,6 @@ __Pyx_RefNannySetupContext("PyInit_momentsPen", 0);
7547
7582
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7548
7583
  #endif
7549
7584
  /*--- Library function declarations ---*/
7550
- /*--- Initialize various global constants etc. ---*/
7551
- if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7552
- stringtab_initialized = 1;
7553
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7554
7585
  if (__pyx_module_is_main_fontTools__pens__momentsPen) {
7555
7586
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7556
7587
  }
@@ -8186,6 +8217,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
8186
8217
  {__pyx_k_r98, sizeof(__pyx_k_r98), 0, 1, 1}, /* PyObject cname: __pyx_n_u_r98 */
8187
8218
  {__pyx_k_r99, sizeof(__pyx_k_r99), 0, 1, 1}, /* PyObject cname: __pyx_n_u_r99 */
8188
8219
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
8220
+ {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
8189
8221
  {__pyx_k_startPoint, sizeof(__pyx_k_startPoint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_startPoint */
8190
8222
  {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */
8191
8223
  {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */
@@ -10039,24 +10071,83 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas
10039
10071
  return (PyObject*) metaclass;
10040
10072
  }
10041
10073
 
10074
+ /* LimitedApiGetTypeDict */
10075
+ #if CYTHON_COMPILING_IN_LIMITED_API
10076
+ static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
10077
+ PyObject *tp_dictoffset_o;
10078
+ Py_ssize_t tp_dictoffset;
10079
+ tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
10080
+ if (unlikely(!tp_dictoffset_o)) return -1;
10081
+ tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
10082
+ Py_DECREF(tp_dictoffset_o);
10083
+ if (unlikely(tp_dictoffset == 0)) {
10084
+ PyErr_SetString(
10085
+ PyExc_TypeError,
10086
+ "'type' doesn't have a dictoffset");
10087
+ return -1;
10088
+ } else if (unlikely(tp_dictoffset < 0)) {
10089
+ PyErr_SetString(
10090
+ PyExc_TypeError,
10091
+ "'type' has an unexpected negative dictoffset. "
10092
+ "Please report this as Cython bug");
10093
+ return -1;
10094
+ }
10095
+ return tp_dictoffset;
10096
+ }
10097
+ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
10098
+ static Py_ssize_t tp_dictoffset = 0;
10099
+ if (unlikely(tp_dictoffset == 0)) {
10100
+ tp_dictoffset = __Pyx_GetTypeDictOffset();
10101
+ if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
10102
+ tp_dictoffset = 0; // try again next time?
10103
+ return NULL;
10104
+ }
10105
+ }
10106
+ return *(PyObject**)((char*)tp + tp_dictoffset);
10107
+ }
10108
+ #endif
10109
+
10110
+ /* SetItemOnTypeDict */
10111
+ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
10112
+ int result;
10113
+ PyObject *tp_dict;
10114
+ #if CYTHON_COMPILING_IN_LIMITED_API
10115
+ tp_dict = __Pyx_GetTypeDict(tp);
10116
+ if (unlikely(!tp_dict)) return -1;
10117
+ #else
10118
+ tp_dict = tp->tp_dict;
10119
+ #endif
10120
+ result = PyDict_SetItem(tp_dict, k, v);
10121
+ if (likely(!result)) {
10122
+ PyType_Modified(tp);
10123
+ if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
10124
+ PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
10125
+ if (!setNameResult) return -1;
10126
+ Py_DECREF(setNameResult);
10127
+ }
10128
+ }
10129
+ return result;
10130
+ }
10131
+
10042
10132
  /* FixUpExtensionType */
10043
10133
  static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
10044
- #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
10134
+ #if __PYX_LIMITED_VERSION_HEX > 0x030900B1
10045
10135
  CYTHON_UNUSED_VAR(spec);
10046
10136
  CYTHON_UNUSED_VAR(type);
10137
+ CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
10047
10138
  #else
10048
10139
  const PyType_Slot *slot = spec->slots;
10140
+ int changed = 0;
10141
+ #if !CYTHON_COMPILING_IN_LIMITED_API
10049
10142
  while (slot && slot->slot && slot->slot != Py_tp_members)
10050
10143
  slot++;
10051
10144
  if (slot && slot->slot == Py_tp_members) {
10052
- int changed = 0;
10053
- #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
10145
+ #if !CYTHON_COMPILING_IN_CPYTHON
10054
10146
  const
10055
- #endif
10147
+ #endif // !CYTHON_COMPILING_IN_CPYTHON)
10056
10148
  PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
10057
10149
  while (memb && memb->name) {
10058
10150
  if (memb->name[0] == '_' && memb->name[1] == '_') {
10059
- #if PY_VERSION_HEX < 0x030900b1
10060
10151
  if (strcmp(memb->name, "__weaklistoffset__") == 0) {
10061
10152
  assert(memb->type == T_PYSSIZET);
10062
10153
  assert(memb->flags == READONLY);
@@ -10080,11 +10171,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
10080
10171
  #endif
10081
10172
  changed = 1;
10082
10173
  }
10083
- #endif
10084
- #else
10085
- if ((0));
10086
- #endif
10087
- #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
10174
+ #endif // CYTHON_METH_FASTCALL
10088
10175
  else if (strcmp(memb->name, "__module__") == 0) {
10089
10176
  PyObject *descr;
10090
10177
  assert(memb->type == T_OBJECT);
@@ -10092,21 +10179,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
10092
10179
  descr = PyDescr_NewMember(type, memb);
10093
10180
  if (unlikely(!descr))
10094
10181
  return -1;
10095
- if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
10096
- Py_DECREF(descr);
10182
+ int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
10183
+ Py_DECREF(descr);
10184
+ if (unlikely(set_item_result < 0)) {
10097
10185
  return -1;
10098
10186
  }
10099
- Py_DECREF(descr);
10100
10187
  changed = 1;
10101
10188
  }
10102
- #endif
10103
10189
  }
10104
10190
  memb++;
10105
10191
  }
10106
- if (changed)
10107
- PyType_Modified(type);
10108
10192
  }
10109
- #endif
10193
+ #endif // !CYTHON_COMPILING_IN_LIMITED_API
10194
+ slot = spec->slots;
10195
+ while (slot && slot->slot && slot->slot != Py_tp_getset)
10196
+ slot++;
10197
+ if (slot && slot->slot == Py_tp_getset) {
10198
+ PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
10199
+ while (getset && getset->name) {
10200
+ if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
10201
+ PyObject *descr = PyDescr_NewGetSet(type, getset);
10202
+ if (unlikely(!descr))
10203
+ return -1;
10204
+ #if CYTHON_COMPILING_IN_LIMITED_API
10205
+ PyObject *pyname = PyUnicode_FromString(getset->name);
10206
+ if (unlikely(!pyname)) {
10207
+ Py_DECREF(descr);
10208
+ return -1;
10209
+ }
10210
+ int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
10211
+ Py_DECREF(pyname);
10212
+ #else
10213
+ CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
10214
+ int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
10215
+ #endif
10216
+ Py_DECREF(descr);
10217
+ if (unlikely(set_item_result < 0)) {
10218
+ return -1;
10219
+ }
10220
+ changed = 1;
10221
+ }
10222
+ ++getset;
10223
+ }
10224
+ }
10225
+ if (changed)
10226
+ PyType_Modified(type);
10227
+ #endif // PY_VERSION_HEX > 0x030900B1
10110
10228
  return 0;
10111
10229
  }
10112
10230
 
@@ -10133,6 +10251,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
10133
10251
  }
10134
10252
 
10135
10253
  /* FetchCommonType */
10254
+ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000
10255
+ static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
10256
+ PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
10257
+ if (result && metaclass) {
10258
+ PyObject *old_tp = (PyObject*)Py_TYPE(result);
10259
+ Py_INCREF((PyObject*)metaclass);
10260
+ #if __PYX_LIMITED_VERSION_HEX >= 0x03090000
10261
+ Py_SET_TYPE(result, metaclass);
10262
+ #else
10263
+ result->ob_type = metaclass;
10264
+ #endif
10265
+ Py_DECREF(old_tp);
10266
+ }
10267
+ return result;
10268
+ }
10269
+ #else
10270
+ #define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
10271
+ #endif
10136
10272
  static int __Pyx_VerifyCachedType(PyObject *cached_type,
10137
10273
  const char *name,
10138
10274
  Py_ssize_t expected_basicsize) {
@@ -10142,6 +10278,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
10142
10278
  "Shared Cython type %.200s is not a type object", name);
10143
10279
  return -1;
10144
10280
  }
10281
+ if (expected_basicsize == 0) {
10282
+ return 0; // size is inherited, nothing useful to check
10283
+ }
10145
10284
  #if CYTHON_COMPILING_IN_LIMITED_API
10146
10285
  PyObject *py_basicsize;
10147
10286
  py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
@@ -10161,7 +10300,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
10161
10300
  }
10162
10301
  return 0;
10163
10302
  }
10164
- static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
10303
+ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
10165
10304
  PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
10166
10305
  int get_item_ref_result;
10167
10306
  const char* object_name = strrchr(spec->name, '.');
@@ -10185,7 +10324,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec
10185
10324
  goto bad;
10186
10325
  }
10187
10326
  CYTHON_UNUSED_VAR(module);
10188
- cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
10327
+ cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases);
10189
10328
  if (unlikely(!cached_type)) goto bad;
10190
10329
  if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
10191
10330
  new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
@@ -10214,6 +10353,42 @@ bad:
10214
10353
  goto done;
10215
10354
  }
10216
10355
 
10356
+ /* CommonTypesMetaclass */
10357
+ PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
10358
+ return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
10359
+ }
10360
+ static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
10361
+ {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
10362
+ {0, 0, 0, 0, 0}
10363
+ };
10364
+ static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
10365
+ {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
10366
+ {0, 0}
10367
+ };
10368
+ static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
10369
+ __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
10370
+ 0,
10371
+ 0,
10372
+ #if PY_VERSION_HEX >= 0x030A0000
10373
+ Py_TPFLAGS_IMMUTABLETYPE |
10374
+ Py_TPFLAGS_DISALLOW_INSTANTIATION |
10375
+ #endif
10376
+ Py_TPFLAGS_DEFAULT,
10377
+ __pyx_CommonTypesMetaclass_slots
10378
+ };
10379
+ static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
10380
+ __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
10381
+ PyObject *bases = PyTuple_Pack(1, &PyType_Type);
10382
+ if (unlikely(!bases)) {
10383
+ return -1;
10384
+ }
10385
+ mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
10386
+ if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
10387
+ return -1;
10388
+ }
10389
+ return 0;
10390
+ }
10391
+
10217
10392
  /* CallTypeTraverse */
10218
10393
  #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
10219
10394
  #else
@@ -11330,7 +11505,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = {
11330
11505
  };
11331
11506
  static int __pyx_CyFunction_init(PyObject *module) {
11332
11507
  __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
11333
- mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
11508
+ mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
11509
+ mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
11334
11510
  if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
11335
11511
  return -1;
11336
11512
  }