Cython 3.2.2__py3-none-any.whl → 3.2.4__py3-none-any.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.
Cython/Build/Cythonize.py CHANGED
@@ -12,10 +12,8 @@ from ..Compiler import Options
12
12
 
13
13
  try:
14
14
  import multiprocessing
15
- parallel_compiles = int(multiprocessing.cpu_count() * 1.5)
16
15
  except ImportError:
17
16
  multiprocessing = None
18
- parallel_compiles = 0
19
17
 
20
18
 
21
19
  def find_package_base(path):
@@ -85,7 +83,8 @@ def _build(ext_modules, parallel):
85
83
  if not modcount:
86
84
  return
87
85
 
88
- serial_execution_mode = modcount == 1 or parallel < 2
86
+ serial_execution_mode = modcount == 1 or (
87
+ parallel is not None and parallel < 2)
89
88
 
90
89
  try:
91
90
  pool_cm = (
@@ -248,8 +247,8 @@ Environment variables:
248
247
  help="use CODESTRING as pre-benchmark setup code for --bench")
249
248
 
250
249
  parser.add_argument('-j', '--parallel', dest='parallel', metavar='N',
251
- type=int, default=parallel_compiles,
252
- help=f'run builds in N parallel jobs (default: {parallel_compiles or 1})')
250
+ type=int, default=None,
251
+ help='run builds in N parallel jobs (default: CPU count)')
253
252
  parser.add_argument('-f', '--force', dest='force', action='store_true', default=None,
254
253
  help='force recompilation')
255
254
  parser.add_argument('-q', '--quiet', dest='quiet', action='store_true', default=None,
@@ -1,6 +1,5 @@
1
1
  from Cython.Build.Cythonize import (
2
2
  create_args_parser, parse_args_raw, parse_args,
3
- parallel_compiles
4
3
  )
5
4
 
6
5
  from Cython.Compiler import Options
@@ -22,7 +21,9 @@ class TestCythonizeArgsParser(TestCase):
22
21
  def are_default(self, options, skip):
23
22
  # empty containers
24
23
  empty_containers = ['directives', 'compile_time_env', 'options', 'excludes']
25
- are_none = ['language_level', 'annotate', 'build', 'build_inplace', 'force', 'quiet', 'lenient', 'keep_going', 'no_docstrings']
24
+ are_none = [
25
+ 'language_level', 'annotate', 'build', 'build_inplace', 'force', 'quiet', 'lenient', 'keep_going', 'no_docstrings', 'parallel'
26
+ ]
26
27
  for opt_name in empty_containers:
27
28
  if len(getattr(options, opt_name))!=0 and (opt_name not in skip):
28
29
  self.assertEqual(opt_name,"", msg="For option "+opt_name)
@@ -31,8 +32,6 @@ class TestCythonizeArgsParser(TestCase):
31
32
  if (getattr(options, opt_name) is not None) and (opt_name not in skip):
32
33
  self.assertEqual(opt_name,"", msg="For option "+opt_name)
33
34
  return False
34
- if options.parallel!=parallel_compiles and ('parallel' not in skip):
35
- return False
36
35
  return True
37
36
 
38
37
  # testing directives:
Cython/Compiler/Code.py CHANGED
@@ -2422,7 +2422,17 @@ class GlobalState:
2422
2422
  writer.putln(f"PyObject **table = {array_cname};")
2423
2423
  writer.putln(f"for (Py_ssize_t i=0; i<{constant_count}; ++i) {{")
2424
2424
  writer.putln("#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING")
2425
+ # We don't want to set the refcount on shared constants (e.g. cached integers)
2426
+ # because setting the refcount isn't thread-safe. The chances are that most of the constants
2427
+ # that this applies to are already immortal though so that isn't a great loss.
2428
+ writer.putln("#if PY_VERSION_HEX < 0x030E0000")
2429
+ writer.putln("if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)")
2430
+ writer.putln("#else")
2431
+ writer.putln("if (PyUnstable_Object_IsUniquelyReferenced(table[i]))")
2432
+ writer.putln("#endif")
2433
+ writer.putln("{")
2425
2434
  writer.putln("Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);")
2435
+ writer.putln("}")
2426
2436
  writer.putln("#else")
2427
2437
  writer.putln("Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);")
2428
2438
  writer.putln("#endif")
@@ -10491,8 +10491,8 @@ class PyCFunctionNode(ExprNode, ModuleNameMixin):
10491
10491
  defaults = '__Pyx_CyFunction_Defaults(struct %s, %s)' % (
10492
10492
  self.defaults_entry.type.objstruct_cname, self.result())
10493
10493
  for arg, entry in self.defaults:
10494
- arg.generate_assignment_code(code, target='%s->%s' % (
10495
- defaults, entry.cname))
10494
+ if arg.is_dynamic:
10495
+ arg.generate_assignment_code(code, cyfunc_struct_target=f'{defaults}->{entry.cname}')
10496
10496
 
10497
10497
  if self.defaults_tuple:
10498
10498
  code.putln('__Pyx_CyFunction_SetDefaultsTuple(%s, %s);' % (
@@ -337,7 +337,8 @@ class NameAssignment:
337
337
  self.is_arg = False
338
338
  self.is_deletion = False
339
339
  self.inferred_type = None
340
- # For generator expression targets, the rhs can have a different scope than the lhs.
340
+ # For generator expression targets in comprehensions (and possibly other things),
341
+ # the rhs can have a different scope than the lhs.
341
342
  self.rhs_scope = rhs_scope
342
343
 
343
344
  def __repr__(self):
@@ -804,7 +805,7 @@ class ControlFlowAnalysis(CythonTransform):
804
805
  entry = self.env.lookup(lhs.name)
805
806
  if entry is None: # TODO: This shouldn't happen...
806
807
  return
807
- self.flow.mark_assignment(lhs, rhs, entry, rhs_scope=rhs_scope)
808
+ self.flow.mark_assignment(lhs, rhs, entry, rhs_scope=(rhs_scope or self.env))
808
809
  elif lhs.is_sequence_constructor:
809
810
  for i, arg in enumerate(lhs.args):
810
811
  if arg.is_starred:
@@ -979,6 +979,17 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
979
979
  code.putln("#endif")
980
980
  code.putln("")
981
981
 
982
+ code.putln("#ifdef CYTHON_FREETHREADING_COMPATIBLE")
983
+ code.putln("#if CYTHON_FREETHREADING_COMPATIBLE")
984
+ code.putln("#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED")
985
+ code.putln("#else")
986
+ code.putln("#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED")
987
+ code.putln("#endif")
988
+ code.putln("#else")
989
+ ft_compatible = "Py_MOD_GIL_NOT_USED" if env.directives["freethreading_compatible"] else "Py_MOD_GIL_USED"
990
+ code.putln(f"#define __Pyx_FREETHREADING_COMPATIBLE {ft_compatible}")
991
+ code.putln("#endif")
992
+
982
993
  c_string_type = env.directives['c_string_type']
983
994
  c_string_encoding = env.directives['c_string_encoding']
984
995
  if c_string_type not in ('bytes', 'bytearray') and not c_string_encoding:
@@ -3628,10 +3639,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
3628
3639
  code.putln("{Py_mod_create, (void*)%s}," % Naming.pymodule_create_func_cname)
3629
3640
  code.putln("{Py_mod_exec, (void*)%s}," % exec_func_cname)
3630
3641
  code.putln("#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING")
3631
- gil_option = ("Py_MOD_GIL_NOT_USED"
3632
- if env.directives["freethreading_compatible"]
3633
- else "Py_MOD_GIL_USED")
3634
- code.putln("{Py_mod_gil, %s}," % gil_option)
3642
+ code.putln("{Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},")
3635
3643
  code.putln("#endif")
3636
3644
  code.putln("#if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE")
3637
3645
  subinterp_option = {
Cython/Compiler/Nodes.py CHANGED
@@ -1078,12 +1078,14 @@ class CArgDeclNode(Node):
1078
1078
  if self.default:
1079
1079
  self.default.annotate(code)
1080
1080
 
1081
- def generate_assignment_code(self, code, target=None, overloaded_assignment=False):
1081
+ def generate_assignment_code(self, code, overloaded_assignment=False,
1082
+ cyfunc_struct_target=None):
1082
1083
  default = self.default
1083
- if default is None or default.is_literal:
1084
+ if default is None or (default.is_literal and cyfunc_struct_target is None):
1084
1085
  return
1085
- if target is None:
1086
- target = self.calculate_default_value_code(code)
1086
+ # Note that even if self.is_dynamic, default may be a literal if it's been
1087
+ # optimized into a literal after analyse_expressions
1088
+ target = cyfunc_struct_target or self.calculate_default_value_code(code)
1087
1089
  default.generate_evaluation_code(code)
1088
1090
  default.make_owned_reference(code)
1089
1091
  result = default.result() if overloaded_assignment else default.result_as(self.type)
@@ -357,7 +357,7 @@ directive_types = {
357
357
  'auto_pickle': bool,
358
358
  'locals': dict,
359
359
  'final' : bool, # final cdef classes and methods
360
- 'collection_type': one_of('sequence'),
360
+ 'collection_type': one_of('sequence', 'mapping'),
361
361
  'nogil' : DEFER_ANALYSIS_OF_ARGUMENTS,
362
362
  'gil' : DEFER_ANALYSIS_OF_ARGUMENTS,
363
363
  'critical_section' : DEFER_ANALYSIS_OF_ARGUMENTS,
@@ -1397,6 +1397,8 @@ class InterpretCompilerDirectives(CythonTransform):
1397
1397
  elif isinstance(old_value, list):
1398
1398
  old_value.extend(value)
1399
1399
  else:
1400
+ if name == "collection_type" and value != optdict[name]:
1401
+ error(node.pos, "Multiple values of collection_type are not supported")
1400
1402
  optdict[name] = value
1401
1403
  else:
1402
1404
  optdict[name] = value
@@ -2323,7 +2325,7 @@ if VALUE is not None:
2323
2325
 
2324
2326
  members = ', '.join(f'self.{v}' for v in all_members_names) + (',' if len(all_members_names) == 1 else '')
2325
2327
  # Even better, we could check PyType_IS_GC.
2326
- any_notnone_members = ' or '.join([f'self.{e.name} is not None' for e in all_members if e.type.is_pyobject] or ['False']),
2328
+ any_notnone_members = ' or '.join([f'self.{e.name} is not None' for e in all_members if e.type.is_pyobject] or ['False'])
2327
2329
 
2328
2330
  pickle_code = f"""
2329
2331
  def __reduce_cython__(self):
@@ -550,7 +550,7 @@ def p_trailer(s: PyrexScanner, node1):
550
550
  # star_expr )
551
551
 
552
552
  @cython.cfunc
553
- def p_call_parse_args(s: PyrexScanner, allow_genexp: cython.bint = True):
553
+ def p_call_parse_args(s: PyrexScanner, allow_genexp: cython.bint = True) -> tuple:
554
554
  # s.sy == '('
555
555
  s.next()
556
556
  positional_args = []
@@ -699,7 +699,7 @@ def p_subscript_list(s: PyrexScanner) -> tuple:
699
699
  #subscript: '.' '.' '.' | test | [test] ':' [test] [':' [test]]
700
700
 
701
701
  @cython.cfunc
702
- def p_subscript(s: PyrexScanner):
702
+ def p_subscript(s: PyrexScanner) -> list:
703
703
  # Parse a subscript and return a list of
704
704
  # 1, 2 or 3 ExprNodes, depending on how
705
705
  # many slice elements were encountered.
@@ -731,7 +731,7 @@ def expect_ellipsis(s: PyrexScanner):
731
731
 
732
732
 
733
733
  @cython.cfunc
734
- def make_slice_nodes(pos, subscripts):
734
+ def make_slice_nodes(pos, subscripts) -> list:
735
735
  # Convert a list of subscripts as returned
736
736
  # by p_subscript_list into a list of ExprNodes,
737
737
  # creating SliceNodes for elements with 2 or
@@ -1041,7 +1041,7 @@ def p_string_literal_shared_read(
1041
1041
  return result
1042
1042
 
1043
1043
  @cython.cfunc
1044
- def _validate_kind_string(pos, systring: str):
1044
+ def _validate_kind_string(pos, systring: str) -> str:
1045
1045
  kind_string = systring.rstrip('"\'').lower()
1046
1046
  if len(kind_string) <= 1 or (len(kind_string) == 2 and kind_string in "rbrurfrtr"):
1047
1047
  return kind_string
@@ -1137,7 +1137,7 @@ def p_string_literal(s: PyrexScanner, kind_override=None) -> tuple:
1137
1137
 
1138
1138
 
1139
1139
  @cython.cfunc
1140
- def p_read_ft_string_expression(s: PyrexScanner):
1140
+ def p_read_ft_string_expression(s: PyrexScanner) -> str:
1141
1141
  strings = []
1142
1142
  while True:
1143
1143
  s.next()
@@ -1154,7 +1154,7 @@ def p_read_ft_string_expression(s: PyrexScanner):
1154
1154
  @cython.cfunc
1155
1155
  def p_ft_string_replacement_field(s: PyrexScanner,
1156
1156
  is_raw: cython.bint, is_single_quoted: cython.bint,
1157
- tf_string_kind: cython.Py_UCS4):
1157
+ tf_string_kind: cython.Py_UCS4) -> list:
1158
1158
  result = []
1159
1159
  conversion_char = format_spec = expr = None
1160
1160
  t_string_expression = None
@@ -1264,7 +1264,7 @@ def p_ft_string_replacement_field(s: PyrexScanner,
1264
1264
  def p_ft_string_middles(s: PyrexScanner,
1265
1265
  is_raw: cython.bint, is_single_quoted: cython.bint,
1266
1266
  is_format_string: cython.bint,
1267
- tf_string_kind: cython.Py_UCS4):
1267
+ tf_string_kind: cython.Py_UCS4) -> list:
1268
1268
  middles: list = []
1269
1269
  builder = StringEncoding.UnicodeLiteralBuilder()
1270
1270
  pos = s.position()
@@ -1302,7 +1302,7 @@ def p_ft_string_middles(s: PyrexScanner,
1302
1302
  return middles
1303
1303
 
1304
1304
  @cython.cfunc
1305
- def p_ft_string_literal(s: PyrexScanner):
1305
+ def p_ft_string_literal(s: PyrexScanner) -> tuple:
1306
1306
  # s.sy == BEGIN_FT_STRING
1307
1307
  kind_string = _validate_kind_string(s.position(), s.systring)
1308
1308
  tf_string_kind: cython.Py_UCS4 = 't' if 't' in kind_string else 'f'
@@ -1988,7 +1988,7 @@ def p_from_import_statement(s: PyrexScanner, first_statement: cython.bint = 0):
1988
1988
 
1989
1989
 
1990
1990
  @cython.cfunc
1991
- def p_imported_name(s: PyrexScanner):
1991
+ def p_imported_name(s: PyrexScanner) -> tuple:
1992
1992
  pos = s.position()
1993
1993
  name = p_ident(s)
1994
1994
  as_name = p_as_name(s)
@@ -2684,7 +2684,7 @@ def p_suite_with_docstring(s: PyrexScanner, ctx, with_doc_only: cython.bint = Fa
2684
2684
 
2685
2685
 
2686
2686
  @cython.cfunc
2687
- def p_positional_and_keyword_args(s: PyrexScanner, end_sy_set, templates = None):
2687
+ def p_positional_and_keyword_args(s: PyrexScanner, end_sy_set, templates = None) -> tuple:
2688
2688
  """
2689
2689
  Parses positional and keyword arguments. end_sy_set
2690
2690
  should contain any s.sy that terminate the argument list.
@@ -4713,7 +4713,7 @@ def p_class_pattern(s: PyrexScanner):
4713
4713
 
4714
4714
 
4715
4715
  @cython.cfunc
4716
- def p_keyword_pattern(s: PyrexScanner):
4716
+ def p_keyword_pattern(s: PyrexScanner) -> tuple:
4717
4717
  if s.sy != "IDENT":
4718
4718
  s.error("Expected identifier")
4719
4719
  arg = p_name(s, s.systring)
Cython/Compiler/Symtab.py CHANGED
@@ -1901,12 +1901,6 @@ class ModuleScope(Scope):
1901
1901
  if self.directives.get('final'):
1902
1902
  entry.type.is_final_type = True
1903
1903
  collection_type = self.directives.get('collection_type')
1904
- if collection_type:
1905
- from .UtilityCode import NonManglingModuleScope
1906
- if not isinstance(self, NonManglingModuleScope):
1907
- # TODO - DW would like to make it public, but I'm making it internal-only
1908
- # for now to avoid adding new features without consensus
1909
- error(pos, "'collection_type' is not a public cython directive")
1910
1904
  if collection_type == 'sequence':
1911
1905
  entry.type.has_sequence_flag = True
1912
1906
 
@@ -101,7 +101,7 @@ cdef extern from *: # Hard-coded utility code hack.
101
101
  arraydescr* ob_descr # struct arraydescr *ob_descr;
102
102
 
103
103
  @property
104
- cdef inline __data_union data(self) nogil:
104
+ cdef inline __data_union data(self) noexcept nogil:
105
105
  return __Pyx_PyArray_Data(self)
106
106
 
107
107
  def __getbuffer__(self, Py_buffer* info, int flags):
@@ -134,7 +134,7 @@ cdef extern from *: # Hard-coded utility code hack.
134
134
 
135
135
  array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
136
136
 
137
- __data_union __Pyx_PyArray_Data(array self) nogil
137
+ __data_union __Pyx_PyArray_Data(array self) noexcept nogil
138
138
  # fast resize/realloc
139
139
  # not suitable for small increments; reallocation 'to the point'
140
140
  int resize(array self, Py_ssize_t n) except -1
@@ -1,5 +1,38 @@
1
1
  from .object cimport PyObject
2
2
 
3
+ cdef extern from *:
4
+ # Backport PyList_GetItemRef, PyList_Extend and PyList_Clear
5
+ """
6
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
7
+ static CYTHON_INLINE PyObject *
8
+ __Pyx_CAPI_PyList_GetItemRef(PyObject *list, Py_ssize_t index)
9
+ {
10
+ PyObject *item = PyList_GetItem(list, index);
11
+ Py_XINCREF(item);
12
+ return item;
13
+ }
14
+ #else
15
+ #define __Pyx_CAPI_PyList_GetItemRef PyList_GetItemRef
16
+ #endif
17
+
18
+ #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030d0000
19
+ static CYTHON_INLINE int
20
+ __Pyx_CAPI_PyList_Extend(PyObject *list, PyObject *iterable)
21
+ {
22
+ return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable);
23
+ }
24
+
25
+ static CYTHON_INLINE int
26
+ __Pyx_CAPI_PyList_Clear(PyObject *list)
27
+ {
28
+ return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
29
+ }
30
+ #else
31
+ #define __Pyx_CAPI_PyList_Extend PyList_Extend
32
+ #define __Pyx_CAPI_PyList_Clear PyList_Clear
33
+ #endif
34
+ """
35
+
3
36
  cdef extern from "Python.h":
4
37
 
5
38
  ############################################################################
@@ -29,12 +62,17 @@ cdef extern from "Python.h":
29
62
  Py_ssize_t PyList_GET_SIZE(object list)
30
63
  # Macro form of PyList_Size() without error checking.
31
64
 
65
+ object PyList_GetItemRef "__Pyx_CAPI_PyList_GetItemRef" (object list, Py_ssize_t index)
66
+ # Return value: New reference.
67
+ # Return the object at position index in the list pointed to by list.
68
+ # The position must be non-negative; indexing from the end of the
69
+ # list is not supported. If index is out of bounds (<0 or >=len(list)),
70
+ # return NULL and set an IndexError exception.
71
+
32
72
  PyObject* PyList_GetItem(object list, Py_ssize_t index) except NULL
33
73
  # Return value: Borrowed reference.
34
- # Return the object at position pos in the list pointed to by
35
- # p. The position must be positive, indexing from the end of the
36
- # list is not supported. If pos is out of bounds, return NULL and
37
- # set an IndexError exception.
74
+ # Like PyList_GetItemRef(), but returns a borrowed reference instead of
75
+ # a strong reference.
38
76
 
39
77
  PyObject* PyList_GET_ITEM(object list, Py_ssize_t i)
40
78
  # Return value: Borrowed reference.
@@ -78,6 +116,20 @@ cdef extern from "Python.h":
78
116
  # may be NULL, indicating the assignment of an empty list (slice
79
117
  # deletion). Return 0 on success, -1 on failure.
80
118
 
119
+ int PyList_Extend "__Pyx_CAPI_PyList_Extend" (object list, object iterable) except -1
120
+ # Extend list with the contents of iterable. This is the same as
121
+ # PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)
122
+ # and analogous to list.extend(iterable) or list += iterable.
123
+ # Raise an exception and return -1 if list is not a list object.
124
+ # Return 0 on success.
125
+
126
+ int PyList_Clear "__Pyx_CAPI_PyList_Clear" (object list) except -1
127
+ # Remove all items from list. This is the same as
128
+ # PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL) and analogous
129
+ # to list.clear() or del list[:].
130
+ # Raise an exception and return -1 if list is not a list object.
131
+ # Return 0 on success.
132
+
81
133
  int PyList_Sort(object list) except -1
82
134
  # Sort the items of list in place. Return 0 on success, -1 on
83
135
  # failure. This is equivalent to "list.sort()".
@@ -6,7 +6,47 @@ cdef extern from "<exception>" namespace "std" nogil:
6
6
 
7
7
  exception_ptr make_exception_ptr[E](E e) noexcept
8
8
  void rethrow_exception(exception_ptr) except +
9
- # current_exception skipped because it'll be almost impossible to use from Cython
9
+ exception_ptr current_exception() noexcept
10
+
11
+ cdef cppclass exception:
12
+ const char* what() noexcept
13
+
14
+ cdef extern from "<stdexcept>" namespace "std" nogil:
15
+ # Omitting the constructors of derived exception classes for now.
16
+ # They can't be stack-allocated easily in Cython because they don't have
17
+ # a nullary constructor. They also can't be thrown in Cython.
18
+ # So they're most useful just as class names when implementing
19
+ # exception handlers.
20
+ cdef cppclass logic_error(exception):
21
+ pass
22
+ cdef cppclass invalid_argument(logic_error):
23
+ pass
24
+ cdef cppclass domain_error(logic_error):
25
+ pass
26
+ cdef cppclass length_error(logic_error):
27
+ pass
28
+ cdef cppclass out_of_range(logic_error):
29
+ pass
30
+
31
+ cdef cppclass runtime_error(exception):
32
+ pass
33
+ cdef cppclass range_error(runtime_error):
34
+ pass
35
+ cdef cppclass overflow_error(runtime_error):
36
+ pass
37
+
38
+ cdef cppclass bad_typeid(exception):
39
+ pass
40
+
41
+ cdef cppclass bad_cast(exception):
42
+ pass
43
+
44
+ cdef cppclass bad_alloc(exception):
45
+ pass
46
+
47
+ cdef cppclass bad_exception(exception):
48
+ pass
49
+
10
50
 
11
51
  cdef extern from *:
12
52
  """
Cython/Shadow.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # cython.* namespace for pure mode.
2
2
 
3
3
  # Possible version formats: "3.1.0", "3.1.0a1", "3.1.0a1.dev0"
4
- __version__ = "3.2.2"
4
+ __version__ = "3.2.4"
5
5
 
6
6
 
7
7
  # BEGIN shameless copy from Cython/minivect/minitypes.py
@@ -103,7 +103,7 @@ class _Optimization:
103
103
  cclass = ccall = cfunc = _EmptyDecoratorAndManager()
104
104
 
105
105
  annotation_typing = returns = wraparound = boundscheck = initializedcheck = \
106
- nonecheck = embedsignature = cdivision = cdivision_warnings = \
106
+ nonecheck = embedsignature = cdivision = cdivision_warnings = collection_type = \
107
107
  always_allow_keywords = profile = linetrace = infer_types = \
108
108
  unraisable_tracebacks = freelist = auto_pickle = cpow = trashcan = \
109
109
  auto_cpdef = c_api_binop_methods = \
@@ -8,9 +8,7 @@ class TestShadow(unittest.TestCase):
8
8
  missing_directives = []
9
9
  extra_directives = []
10
10
  for full_directive in Options.directive_types.keys():
11
- # Python 2 doesn't support "directive, *rest = full_directive.split('.')"
12
- split_directive = full_directive.split('.')
13
- directive, rest = split_directive[0], split_directive[1:]
11
+ directive, *rest = full_directive.split('.')
14
12
 
15
13
  scope = Options.directive_scopes.get(full_directive)
16
14
  if scope and len(scope) == 1 and scope[0] == "module":
@@ -18,10 +16,6 @@ class TestShadow(unittest.TestCase):
18
16
  if hasattr(Shadow, directive):
19
17
  extra_directives.append(full_directive)
20
18
  continue
21
- if full_directive == "collection_type":
22
- # collection_type is current restricted to utility code only
23
- # so doesn't need to be in Shadow
24
- continue
25
19
  if full_directive == "staticmethod":
26
20
  # staticmethod is a weird special-case and not really intended to be
27
21
  # used from the cython module
Cython/Utility/Builtins.c CHANGED
@@ -631,13 +631,13 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
631
631
 
632
632
  static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
633
633
  PyObject* value;
634
- #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
634
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
635
+ PyDict_SetDefaultRef(d, key, default_value, &value);
636
+ #elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
635
637
  PyObject *args[] = {d, key, default_value};
636
638
  value = PyObject_VectorcallMethod(PYIDENT("setdefault"), args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
637
639
  #elif CYTHON_COMPILING_IN_LIMITED_API
638
640
  value = PyObject_CallMethodObjArgs(d, PYIDENT("setdefault"), key, default_value, NULL);
639
- #elif PY_VERSION_HEX >= 0x030d0000
640
- PyDict_SetDefaultRef(d, key, default_value, &value);
641
641
  #else
642
642
  value = PyDict_SetDefault(d, key, default_value);
643
643
  if (unlikely(!value)) return NULL;
@@ -1572,10 +1572,7 @@ __pyx_err:;
1572
1572
 
1573
1573
  if (likely(unbound_result_func)) {
1574
1574
  if (self->self) {
1575
- __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
1576
-
1577
- // TODO: move this to InitClassCell
1578
- __Pyx_CyFunction_SetClassObj(unbound, __Pyx_CyFunction_GetClassObj(self));
1575
+ assert(__Pyx_CyFunction_GetClassObj(unbound_result_func) == __Pyx_CyFunction_GetClassObj(self));
1579
1576
 
1580
1577
  result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
1581
1578
  self->self, self->self);
@@ -1673,7 +1670,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
1673
1670
  if (unlikely(!new_func))
1674
1671
  goto bad;
1675
1672
 
1676
- __Pyx_CyFunction_SetClassObj(new_func, __Pyx_CyFunction_GetClassObj(binding_func));
1673
+ assert(__Pyx_CyFunction_GetClassObj(new_func) == __Pyx_CyFunction_GetClassObj(binding_func));
1677
1674
 
1678
1675
  func = (PyObject *) new_func;
1679
1676
  }
@@ -59,7 +59,7 @@ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int al
59
59
  //@requires: TypeConversion.c::GCCDiagnostics
60
60
 
61
61
  static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
62
- PyObject *module, *decompress, *compressed_bytes, *decompressed;
62
+ PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
63
63
 
64
64
  const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
65
65
 
@@ -69,7 +69,7 @@ static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int al
69
69
  #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
70
70
  if (algo == 3) {
71
71
  PyObject *fromlist = Py_BuildValue("[O]", methodname);
72
- if (unlikely(!fromlist)) return NULL;
72
+ if (unlikely(!fromlist)) goto bad;
73
73
  module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
74
74
  Py_DECREF(fromlist);
75
75
  } else
Cython/Utility/TString.c CHANGED
@@ -17,8 +17,10 @@ Py_VISIT((PyObject*)traverse_module_state->__pyx_templatelib_Interpolation);
17
17
 
18
18
  //////////////////////////// InitializeTemplateLib.module_state_clear ////////////////////////////
19
19
 
20
- Py_CLEAR((PyObject*)traverse_module_state->__pyx_templatelib_Template);
21
- Py_CLEAR((PyObject*)traverse_module_state->__pyx_templatelib_Interpolation)
20
+ Py_XDECREF((PyObject*)clear_module_state->__pyx_templatelib_Template);
21
+ clear_module_state->__pyx_templatelib_Template = 0;
22
+ Py_XDECREF((PyObject*)clear_module_state->__pyx_templatelib_Interpolation);
23
+ clear_module_state->__pyx_templatelib_Interpolation = 0;
22
24
 
23
25
  //////////////////////////// InitializeTemplateLib.proto ///////////////////////////
24
26
 
@@ -325,7 +327,7 @@ static PyObject* __Pyx_MakeTemplateLibTemplate(PyObject *strings, PyObject *inte
325
327
  #endif
326
328
  zipped_tuple = PyTuple_New(strings_len + interpolations_len);
327
329
  if (!zipped_tuple) goto end;
328
- for (Py_ssize_t i=0; (i<interpolations_len && i<strings_len); ++i) {
330
+ for (Py_ssize_t i=0; (i<interpolations_len || i<strings_len); ++i) {
329
331
  if (i < strings_len) {
330
332
  PyObject *s = __Pyx_PyTuple_GET_ITEM(strings, i);
331
333
  #if !CYTHON_ASSUME_SAFE_MACROS
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.1
2
+ Name: Cython
3
+ Version: 3.2.4
4
+ Summary: The Cython compiler for writing C extensions in the Python language.
5
+ Home-page: https://cython.org/
6
+ Author: Robert Bradshaw, Stefan Behnel, David Woods, Greg Ewing, et al.
7
+ Author-email: cython-devel@python.org
8
+ License: Apache-2.0
9
+ Project-URL: Documentation, https://cython.readthedocs.io/
10
+ Project-URL: Donate, https://cython.readthedocs.io/en/latest/src/donating.html
11
+ Project-URL: Source Code, https://github.com/cython/cython
12
+ Project-URL: Bug Tracker, https://github.com/cython/cython/issues/
13
+ Project-URL: User Group, https://groups.google.com/g/cython-users
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.13
26
+ Classifier: Programming Language :: Python :: 3.14
27
+ Classifier: Programming Language :: Python :: Implementation :: CPython
28
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
29
+ Classifier: Programming Language :: Python :: Implementation :: Stackless
30
+ Classifier: Programming Language :: C
31
+ Classifier: Programming Language :: C++
32
+ Classifier: Programming Language :: Cython
33
+ Classifier: Topic :: Software Development :: Code Generators
34
+ Classifier: Topic :: Software Development :: Compilers
35
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
36
+ Classifier: Typing :: Typed
37
+ Requires-Python: >=3.8
38
+ Description-Content-Type: text/x-rst
39
+
40
+ The Cython language makes writing C extensions for the Python language as
41
+ easy as Python itself. Cython is a source code translator based on Pyrex_,
42
+ but supports more cutting edge functionality and optimizations.
43
+
44
+ The Cython language is a superset of the Python language (almost all Python
45
+ code is also valid Cython code), but Cython additionally supports optional
46
+ static typing to natively call C functions, operate with C++ classes and
47
+ declare fast C types on variables and class attributes. This allows the
48
+ compiler to generate very efficient C code from Cython code.
49
+
50
+ This makes Cython the ideal language for writing glue code for external
51
+ C/C++ libraries, and for fast C modules that speed up the execution of
52
+ Python code.
53
+
54
+ The newest Cython release can always be downloaded from https://cython.org/.
55
+ Unpack the tarball or zip file, enter the directory, and then run::
56
+
57
+ pip install .
58
+
59
+ Note that for one-time builds, e.g. for CI/testing, on platforms that are not
60
+ covered by one of the wheel packages provided on PyPI *and* the pure Python wheel
61
+ that we provide is not used, it is substantially faster than a full source build
62
+ to install an uncompiled (slower) version of Cython with::
63
+
64
+ NO_CYTHON_COMPILE=true pip install .
65
+
66
+ .. _Pyrex: https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
67
+
68
+ 3.2.4 (2026-01-04)
69
+ ==================
70
+
71
+ Features added
72
+ --------------
73
+
74
+ * In preparation of Cython 3.3, a new decorator ``@collection_type(tname)`` can be used
75
+ to advertise an extension type as being a ``'sequence'`` or ``'mapping'``. This currently
76
+ only has the effect of setting the ``Py_TPFLAGS_SEQUENCE`` flag on the type or not, but
77
+ is provided for convenience to allow using the new decorator already in Cython 3.2 code.
78
+
79
+ * Several C++ exception declarations were added to ``libcpp.exceptions``.
80
+ (Github issue https://github.com/cython/cython/issues/7389)
81
+
82
+ Bugs fixed
83
+ ----------
84
+
85
+ * Pseudo-literal default values of function arguments like ``arg=str()`` could generate
86
+ invalid C code when internally converted into a real literal.
87
+ (Github issue https://github.com/cython/cython/issues/6192)
88
+
89
+ * The pickle serialisation of extension types using the ``auto_pickle`` feature was
90
+ larger than necessary since 3.2.0 for types without Python object attributes.
91
+ It is now back to the state before 3.2.0 again.
92
+ (Github issue https://github.com/cython/cython/issues/7443)
93
+
94
+ * Constants are now only made immortal on freethreading Python if they are not shared.
95
+ (Github issue https://github.com/cython/cython/issues/7439)
96
+
97
+ * ``PyDict_SetDefaultRef()`` is now used when available to avoid temporary borrowed references.
98
+ (Github issue https://github.com/cython/cython/issues/7347)
99
+
100
+ * Includes all fixes as of Cython 3.1.8.
101
+
102
+ 3.1.8 (2026-01-03):
103
+
104
+ * Assignment expressions used in comprehensions could look at the wrong scope,
105
+ thus using different variables and different data.
106
+ (Github issue https://github.com/cython/cython/issues/6547)
107
+
108
+ * Some internal C symbols were not declared as ``static``, preventing static linking
109
+ of multiple modules.
110
+ Patch by Yury Popov. (Github issue https://github.com/cython/cython/issues/7310)
111
+
112
+ * Accidentally using ``except +`` in C mode did not raise a compile error but generated
113
+ invalid C code leading to obscure error messages.
114
+ Patch by user202729. (Github issue https://github.com/cython/cython/issues/6560)
115
+
116
+ 3.1.7 (2025-11-12):
117
+
118
+ * Unicode characters formatted from C integers with padding, as in ``f"{value:XXc}"``,
119
+ could result in invalid Python string objects since Cython 3.1.0.
120
+ Also, lone surrogates failed to format in this way.
121
+ (Github issue https://github.com/cython/cython/issues/7298)
122
+
123
+ * Assigning nested structs from a list of structs (item by item) could crash Cython.
124
+ (Github issue https://github.com/cython/cython/issues/7308)
125
+
126
+ * Cython incorrectly called ``PyList_GetItemRef()`` in PyPy and GraalPython before Py3.13.
127
+ (Github issue https://github.com/cython/cython/issues/7269)
128
+
129
+ * Trying to instantiate internal types used by Cython is now prohibited.
130
+ (Github issue https://github.com/cython/cython/issues/7263)
131
+
132
+ 3.1.6 (2025-10-23):
133
+
134
+ * Unicode characters formatted from C integers with ``f"{value:c}"`` could result in
135
+ invalid Python string objects since Cython 3.1.0.
136
+ (Github issue https://github.com/cython/cython/issues/7240)
137
+
138
+ * ``cythonize`` (program and function) now uses ``concurrent.futures.ProcessPoolExecutor``
139
+ instead of ``multiprocessing.Pool`` to fix a hang on build failures in parallel builds.
140
+ A possible work-around is to disable parallel builds.
141
+ Patch by Sviatoslav Sydorenko. (Github issue https://github.com/cython/cython/issues/7183)
142
+
143
+ 3.1.5 (2025-10-20):
144
+
145
+ * Conversion from C++ strings longer than ``PY_SSIZE_T_MAX`` did not validate the length.
146
+
147
+ * Some non-Limited API code was incorrectly used in generated header files.
148
+ (Github issue https://github.com/cython/cython/issues/7157)
149
+
150
+ * Optimised unpacking of Python integers in expressions uses a slightly safer scheme.
151
+ (Github issue https://github.com/cython/cython/issues/7134)
152
+
153
+ * Empty return statements were not always reported when tracing.
154
+ (Github issue https://github.com/cython/cython/issues/7022)
155
+
156
+ * Value conversion errors when tracing C return statements no longer fail the trace
157
+ but fall back to reporting ``None`` returns instead.
158
+ (Github issue https://github.com/cython/cython/issues/6503)
@@ -2,7 +2,7 @@ cython.py,sha256=OTJCP0F_fecQWMsGOPJDuFU7brM1ScJAATH6ek98ho4,632
2
2
  Cython/CodeWriter.py,sha256=k1SAPvsjXum7dhX9IjZ3wXuDUOzzFKYEbNZSxMKEwos,24276
3
3
  Cython/Coverage.py,sha256=WGY5BW1nBcJ86f4Lrs6ZZIuFKCdngsEizs4Kor0iRsc,18783
4
4
  Cython/Debugging.py,sha256=vFtJhn7QstMf5gnYru2qHIz5ZjPg1KSlZVGHr-pBCwM,552
5
- Cython/Shadow.py,sha256=HhmXZxYWwK_CprThLjdsHQr4r_5bpNKp7bfWjq6fJK0,19632
5
+ Cython/Shadow.py,sha256=jz6jdcQf_U0c1hhGe-uyvG2MXY-uw_01IXPr6pGac64,19650
6
6
  Cython/Shadow.pyi,sha256=BaaRtWtFlBVM14LOD9ql-9Uw1UDZV3AOT2AWULk1WUw,18597
7
7
  Cython/StringIOTree.py,sha256=8u4R5jhUzqYvSX1w5_RrvxbgUvaMqW8jhQgXcCNKIkE,5570
8
8
  Cython/TestUtils.py,sha256=rph07UD41dNbdOjqQx_vNu2c0b3Ib1UeMxNYao_vxJU,15584
@@ -12,7 +12,7 @@ Cython/__init__.pyi,sha256=b6tWj5MgrMJz8EAV9MOqTbaFGvIxCOzH2bBkhrC80GU,185
12
12
  Cython/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  Cython/Build/BuildExecutable.py,sha256=OhySP6G2ppkA_Tzutv2Mvxt3YyhViy_aU7vAeGCjEbY,4742
14
14
  Cython/Build/Cache.py,sha256=kdxcA-x7-hck6K6VuMajP4pYMWQH_4pkzwvk5qOawiE,6855
15
- Cython/Build/Cythonize.py,sha256=T0FMC7GTT5-4RKsOTeqJ6mJHZ1O7AS3PHPGZQVvl5bQ,13557
15
+ Cython/Build/Cythonize.py,sha256=9dYCW_To76B0wZA5GO3DNWjZn8PllkFvef-X7d-nbRc,13475
16
16
  Cython/Build/Dependencies.py,sha256=eY-zCjgd_ENgIErJw-yGVzv4lWveeNhljFaRcFN4wMw,51710
17
17
  Cython/Build/Distutils.py,sha256=iO5tPX84Kc-ZWMocfuQbl_PqyC9HGGIRS-NiKI60-ZE,49
18
18
  Cython/Build/Inline.py,sha256=hcRhJJ8XWRYZJ7eGW8P-Yh5DhWCQm2Hxr9Im7WP352g,16298
@@ -20,7 +20,7 @@ Cython/Build/IpythonMagic.py,sha256=X11ClQS2psBcjnI4S1Ovyz_3sW8xEjRqXIh-44ycdek,
20
20
  Cython/Build/SharedModule.py,sha256=6WL0f3NxG2SwRy_humjasLk-FpsbY-ukK4iopuGsE0s,3666
21
21
  Cython/Build/__init__.py,sha256=UCsI8hI_a75i0iWwZQfuaoKTH5LW6z2b5GhN9QaJ0zo,339
22
22
  Cython/Build/Tests/TestCyCache.py,sha256=0yu2hshimJNwdjnfbRZdxXWTfy_KkLuqJIugcBf3WeY,6554
23
- Cython/Build/Tests/TestCythonizeArgsParser.py,sha256=w8mw0sS_OV-8j1sdevv5wE28LZkhNFRmHdLcpddaCgE,20257
23
+ Cython/Build/Tests/TestCythonizeArgsParser.py,sha256=l7dgs39KO-ZPxQzRVccg3wvzQuBLOIi9hqB9jollw5c,20167
24
24
  Cython/Build/Tests/TestDependencies.py,sha256=E8yGrYy03JvVPwtYB7JGE-VOCWyYB2ZkQpXKTORpyps,5566
25
25
  Cython/Build/Tests/TestInline.py,sha256=pUvDhJOdgiHX0yeuZpKXnk4i3QxLzv9apwiVmdY1FLQ,5695
26
26
  Cython/Build/Tests/TestIpythonMagic.py,sha256=9GL8U_Jtyk-sAdEBzCS81RkVjxeM0Jrs2-zAhfFUb54,9004
@@ -34,15 +34,15 @@ Cython/Compiler/Buffer.py,sha256=NMqvFYIofuS93840lWrNcvDXlBhuXgKLoEuMs0PffLk,269
34
34
  Cython/Compiler/Builtin.py,sha256=sfW7MGgRm39TG2QoTF0GPhIVVy_8gW-eylGFaLRiy8I,42433
35
35
  Cython/Compiler/CmdLine.py,sha256=6u--_tFCXMEjDQaqYXbH4AXed5jXcOhBWGefngFB_Aw,13339
36
36
  Cython/Compiler/Code.pxd,sha256=-bYyHehjGEiFoe8bqT-2djaHann3jnU86gVgymoIpL0,3918
37
- Cython/Compiler/Code.py,sha256=dBNNyklkMCzaIYIGvjp7yPi48xS87JwRDHT7fHyGTbs,144440
37
+ Cython/Compiler/Code.py,sha256=YzRbI3MUjNHLDep1KB3ib1AA-EOuenOnQJ7QJqkKwvU,145056
38
38
  Cython/Compiler/CodeGeneration.py,sha256=aEW8IwXvwEOsde0-RxvAi_cb8_qdaDGxH_nS_VFwKWc,1068
39
39
  Cython/Compiler/CythonScope.py,sha256=b_RU0YKr4UYzfrhAJE9xNdYAHi1H44hczsbBA9tiq6E,7325
40
40
  Cython/Compiler/Dataclass.py,sha256=NhP7E63rJzLpE98ZVrYCbNt-W0aYLh9r29e6yT0KnCQ,36595
41
41
  Cython/Compiler/DebugFlags.py,sha256=-ht7qWQyoJO6H5o0XJgwVjj5gWayuol-H2HoLqiCXsE,713
42
42
  Cython/Compiler/Errors.py,sha256=_qycMnE9-dH-uh--Wv20jFXlXkRl8UGIAsAdlIig9xM,9160
43
- Cython/Compiler/ExprNodes.py,sha256=jVQYixwSu_fx5tP7RKiu4RY3WOJzFpkccGvd2VZFT_8,635396
43
+ Cython/Compiler/ExprNodes.py,sha256=-GxXrFDaf_oX_GWAUE9AUkd_7Pilulb3YfeVOx7BthU,635422
44
44
  Cython/Compiler/FlowControl.pxd,sha256=0wDFfkjWddMSOjs76KQSePJBMS1CQk5RjESRHXRkYww,2499
45
- Cython/Compiler/FlowControl.py,sha256=P4L87MdPre8loo2U2-ruXFz3Pz7jkUJEpg10db76_Vg,50821
45
+ Cython/Compiler/FlowControl.py,sha256=MInme8kZXFVISMeKxmKHblHCNvHyzjwH5QL_jztFWmM,50891
46
46
  Cython/Compiler/FusedNode.py,sha256=gXGXpM6XPZtVT7fGr5g19Id0flqQf4OrcR5_zn1VP4Y,41407
47
47
  Cython/Compiler/Future.py,sha256=NFtSWCJYqPlEqWZ5Ob_bv_pDfW6iS7pPYWeGH1OGA5g,629
48
48
  Cython/Compiler/Interpreter.py,sha256=2C-tJZkVM_8PM48PF1QGJHy_ohTjkWKTc-xdaRTG6RQ,1831
@@ -51,22 +51,22 @@ Cython/Compiler/LineTable.py,sha256=epP6DoefUR7JCK9OUOyoYcxMWhBEwyTWOr3E7vJRqa4,
51
51
  Cython/Compiler/Main.py,sha256=8BCgxfGhYNGvhROKqV7ovifvQJvWn2xOQBB3uBiAZ5g,35011
52
52
  Cython/Compiler/MatchCaseNodes.py,sha256=yVGVAsc1yrda1jHTAI7mZ2-SL67tNdcfOn-ugdCRWPs,7792
53
53
  Cython/Compiler/MemoryView.py,sha256=pyy1oidHhmYAprfxjhX7fweDXzrxMkEbSICKFm2vd4o,31485
54
- Cython/Compiler/ModuleNode.py,sha256=7HAhU4H5VEeZxN42HGlq7dYRGA3faauucz3YsQmyULk,194712
54
+ Cython/Compiler/ModuleNode.py,sha256=KfHvXpp8G8S1i_1-xMwqzflqnDWMJRRSuvu0pZhGNWY,195154
55
55
  Cython/Compiler/Naming.py,sha256=xneFFCsB68xZhghXAxA2GnRrooWMumxss20B1I0avqk,11159
56
- Cython/Compiler/Nodes.py,sha256=SPMs4eHpOSsUakYl2NtNErXUZ_OwI5DRHcoWz12gRrg,454893
56
+ Cython/Compiler/Nodes.py,sha256=cQLsyXcyrwme2B9KrX-kPO6gJgvLz2lnxkMO79HLUGI,455112
57
57
  Cython/Compiler/Optimize.py,sha256=CX-UEAmTqAc4JsMxpRsKPx_7yaaEzwewcxHc7c2Roq0,228209
58
- Cython/Compiler/Options.py,sha256=DegABgz_JQbPN_hHfOTxDd3zKHXvqoYedB9jgco4fnk,32062
58
+ Cython/Compiler/Options.py,sha256=GkzO1lGVqwgHE0PzPEERwmsTUv5UYCxyJMK3iHJv8SQ,32073
59
59
  Cython/Compiler/ParseTreeTransforms.pxd,sha256=mkdSaFvc5we32bs0RNFwbODQMsTHIU0jIlpZuFtHnaU,2268
60
- Cython/Compiler/ParseTreeTransforms.py,sha256=nL6TdknzbWsFTThUaMJeKcDakIYf7cDFk6vsaWeTFg4,186705
60
+ Cython/Compiler/ParseTreeTransforms.py,sha256=_iOgpLJF_cQ42FkTrkPHeORwSmBgxYujelB8eVqWA9o,186877
61
61
  Cython/Compiler/Parsing.pxd,sha256=A5Ckd1TecRLV_NDx4IzhquYdMsM0BGcDWh7LyXOjKIg,351
62
- Cython/Compiler/Parsing.py,sha256=RsV7WGd7OxK7tEthCOqF2m9z_hSbUn662d-m0z1MCws,156894
62
+ Cython/Compiler/Parsing.py,sha256=6uZTj0cQLobkVyb-91mO_tUlqxytq-4M4x-6utZAJiw,156985
63
63
  Cython/Compiler/Pipeline.py,sha256=JyYMnRekoKRBe9yOvAuW39Gy-pTitJm5jD_qfO9BAeU,16230
64
64
  Cython/Compiler/PyrexTypes.py,sha256=2qtM3pHiMwMdL6yR6iG6xwqR2JA3tL5S7JWmvORIEpY,222972
65
65
  Cython/Compiler/Pythran.py,sha256=wiRE1buAxQ0NFbxg7DHyyd03I6qgLp-KP_fokAvSii4,7888
66
66
  Cython/Compiler/Scanning.pxd,sha256=vcNaZoZdifzj5H_cbFa1eACNNCKko9iwWaOHuWQDfWs,1358
67
67
  Cython/Compiler/Scanning.py,sha256=kZI5h8k3ZoLA_nqCAx3nY2QZljuFi3QwpjZ9N9d6GGc,25212
68
68
  Cython/Compiler/StringEncoding.py,sha256=0o6B-tFxKhUdQ79eJfHZhdLun69qdkVUeznffpBAxtI,8487
69
- Cython/Compiler/Symtab.py,sha256=C18rR7_afF4id7vLEqKI4JNyV4G33d5RYWLlEB1LoCg,137775
69
+ Cython/Compiler/Symtab.py,sha256=gGJU2_0b_kDiWDT5W7ml-3VeLK4oLbtTciLRwiAnHz8,137382
70
70
  Cython/Compiler/TreeFragment.py,sha256=1AscujwN_mCFeO137PGy1ghCnJ17L9uYoJfqc-7h9VY,9514
71
71
  Cython/Compiler/TreePath.py,sha256=Vht_mzZpptXKJw2t_TM-PBYHtZIXXvZFWxjNkhPr9yg,7960
72
72
  Cython/Compiler/TypeInference.py,sha256=fmetS6rcT_ELhkCWMOukgOF5QarS-z0EyhvGudwvZuM,22446
@@ -113,7 +113,7 @@ Cython/Distutils/extension.py,sha256=hJ8VeNgGyxdz7Lke_Bg7FUkiC6mu9uNz9TosfXsfTaI
113
113
  Cython/Distutils/old_build_ext.py,sha256=T-0H1lPbaP1wa_YgV9JkattbYOhHDHqQ9gsWkqYkkd0,13723
114
114
  Cython/Includes/openmp.pxd,sha256=3GTRd5JH31CvfTzXErglXnyf_jye1Gvk9O4giTa6pc0,1712
115
115
  Cython/Includes/cpython/__init__.pxd,sha256=dUl8RHGxo-181oczdAl7vND_jkcMaHnK4A2ji1hJaos,8100
116
- Cython/Includes/cpython/array.pxd,sha256=yMNqxS6_3TlHriTDGZ3Gw_CBWMHZeP0W6tV26TJlhdI,6581
116
+ Cython/Includes/cpython/array.pxd,sha256=11nQbNFyD9ILmahlOHJUdUYRMDujOkaRW_8g2UG_RxY,6599
117
117
  Cython/Includes/cpython/bool.pxd,sha256=2_ouVZUNuCHLVxpNwzQ4bCExpZTj354KcQ0iRv48LZs,1358
118
118
  Cython/Includes/cpython/buffer.pxd,sha256=wm7aHygGUof_H3-JyICOek_xiU6Oks178ark1Nfk-a0,4870
119
119
  Cython/Includes/cpython/bytearray.pxd,sha256=00A4Jz669d43AirqCWwswlVxaykwj1f3zNgMSYOYD74,1453
@@ -136,7 +136,7 @@ Cython/Includes/cpython/getargs.pxd,sha256=268twKzdiAkQMXMsetNiNlNqaqzlKtiBENKbh
136
136
  Cython/Includes/cpython/instance.pxd,sha256=qCbxPeHKOJbuszDu3UEaI-KLX9lTopuaNCcpoHJ9ngU,985
137
137
  Cython/Includes/cpython/iterator.pxd,sha256=o52mLHbdm14Kqant2hR2zAdYzqK4fkSWZtBcRmpoP-I,1319
138
138
  Cython/Includes/cpython/iterobject.pxd,sha256=5UEZZwG5zyzxoCpknoQuh91zPUV11Uxr6F1taJdTv8k,1036
139
- Cython/Includes/cpython/list.pxd,sha256=HhnwchBGhPIAoObzIXyg33KqvSxBRveWoq34iZM508s,4096
139
+ Cython/Includes/cpython/list.pxd,sha256=jBR_a3d8sSamhIhMnhrgjkBCVJWI1iNc230JXLpCW88,6049
140
140
  Cython/Includes/cpython/long.pxd,sha256=1gN-O5AcV4B_r974qxW9YDr7NedDyDrTRjOelClvoyA,7047
141
141
  Cython/Includes/cpython/longintrepr.pxd,sha256=zHZAj59YfzjVn-acRB8D6AELEhkO2hsejtBB4gwzQrA,335
142
142
  Cython/Includes/cpython/mapping.pxd,sha256=DI5_kOp78IaYx77qIWpetu13iMEgGXZew84mTsCPYtM,2692
@@ -189,7 +189,7 @@ Cython/Includes/libcpp/cmath.pxd,sha256=-_jnjIWY47jybkNnGrMk8ewZeGaWU0ezMWAZm9UC
189
189
  Cython/Includes/libcpp/complex.pxd,sha256=JtuQuknvS6GQ0FfyJGQ914DXvzNEaF1-z9D0jST6gXM,2995
190
190
  Cython/Includes/libcpp/condition_variable.pxd,sha256=G3i6e6j4KQtO-dOUWUVc7-BcYT1HRKQCCn9zUp4B3mA,18168
191
191
  Cython/Includes/libcpp/deque.pxd,sha256=SwgYrnqq6OMQMSOEFTZpnpRsii7pIAT-06bLxMS5w7M,6718
192
- Cython/Includes/libcpp/exception.pxd,sha256=AMIC8ZeCT0_rVcsy85rna4OBdOOELAriVXBKoI4zdUo,3175
192
+ Cython/Includes/libcpp/exception.pxd,sha256=n8o8qSyrquGmkoW4JrCzyW0X1IcurW5YNLbvtlpi3vA,4254
193
193
  Cython/Includes/libcpp/execution.pxd,sha256=I2KizUy9DGm_0edrd2BFdHPwyeip2ZcDxqdwb0t7taI,515
194
194
  Cython/Includes/libcpp/forward_list.pxd,sha256=o2ThwKyJWZrNT4ZMB1aYmf-2wqYiqSCDdfVswpo8S8I,2429
195
195
  Cython/Includes/libcpp/functional.pxd,sha256=kMul7WB1J0X2-611AMtXq6sP9jYYk3YO8zZoDKFaeDU,722
@@ -261,7 +261,7 @@ Cython/Tempita/_tempita.py,sha256=lj6mlSNyuJ3hHIsODq7lWbzLyL5Gak6ZVr0tc2vA2qI,37
261
261
  Cython/Tests/TestCodeWriter.py,sha256=_LonlPtsfkTLZBEQXMk8rOyJVvq417uzf01ha5alwGE,3783
262
262
  Cython/Tests/TestCythonUtils.py,sha256=VnOT9GxbE3uxEOVYms8UKFRy2w0IUEinQay8BZ6VQ8k,6691
263
263
  Cython/Tests/TestJediTyper.py,sha256=hroG-mBTs3HzIXCnZTDJuXDSUbVGrorIQGShONTqpxU,6780
264
- Cython/Tests/TestShadow.py,sha256=ZLFhltcbcfc2olENzz1ARHOcGX9D4p9Y9nbwPM-C0BA,5107
264
+ Cython/Tests/TestShadow.py,sha256=EF4kC4iC0Ng_2DUj2H9p5oDd5DQa9RVXY-d9iHYPSMk,4748
265
265
  Cython/Tests/TestStringIOTree.py,sha256=vTuu3z32WTcmJaf0fBq62NMghYtaPL2rRnfdl2WM--4,1946
266
266
  Cython/Tests/TestTestUtils.py,sha256=w4SVcZ8G9Brr_2XGkoQl1EkWR8_sI9LPDAw2cCRQ13U,2901
267
267
  Cython/Tests/__init__.py,sha256=jOqtmPLCvMCq0xVMwGekuLpBmVgq0xtPFmUePySdOjs,13
@@ -269,7 +269,7 @@ Cython/Tests/xmlrunner.py,sha256=1X79TBIYWOcZIzoylOSu9zULxVIR4xvq-RZ7f8Fn600,146
269
269
  Cython/Utility/AsyncGen.c,sha256=MG4LN14ozyq3JruA1Ad8I9ZnjlASxO2kwfvHTcAHXuU,33376
270
270
  Cython/Utility/Buffer.c,sha256=TcJ4eSxi1NxD51NH2GEK-dXgXdmVFIQcHSq22azfB2U,28258
271
271
  Cython/Utility/BufferFormatFromTypeInfo.pxd,sha256=KoGGKw7rW8Utav9xrwVZpsLX-vlpFe3Xv0hmp45PimM,97
272
- Cython/Utility/Builtins.c,sha256=76n9lDGzDe37cskDojBYSXozaPTvy9AS_TFdm_Fj56U,26733
272
+ Cython/Utility/Builtins.c,sha256=Ctej-HIvVSiZqTNPvh1hEEojRcGDP6LwzVJOOiPrgXA,26814
273
273
  Cython/Utility/CConvert.pyx,sha256=UFlPDRT9anal0RpY03hXsejEcwp-RXJSnLy6LbbnmPQ,4471
274
274
  Cython/Utility/CMath.c,sha256=rP6O5u23EybDGimRCHfy8WTpyxhPu5G1F6ksEmrgKnQ,3044
275
275
  Cython/Utility/CommonStructures.c,sha256=cXOrFQv0DP8QX2CF4u_2O2lFW41WC3nTNwSKRVt3B7M,7926
@@ -278,7 +278,7 @@ Cython/Utility/Coroutine.c,sha256=mnN1zdID44Jn-0qF5Bw17QA5gloWpO8JTjiF7ggzuF8,85
278
278
  Cython/Utility/CpdefEnums.pyx,sha256=TMXyfhDeip3zqatMgNEQTQiss41nnp-PzFGn78tgBAs,3531
279
279
  Cython/Utility/CppConvert.pyx,sha256=onbI09dQzC6ZJxvzosS-WuvweIeh3f0rd65Xor7G3AU,7317
280
280
  Cython/Utility/CppSupport.cpp,sha256=vR1G8qqdyLWTk4quKz5v6Z1syIMrfPldB9IzbwkYxDo,5464
281
- Cython/Utility/CythonFunction.c,sha256=BCAiHjYiVBWils4k776a4UvBaDmuE7OSOFkygPXPtZE,63367
281
+ Cython/Utility/CythonFunction.c,sha256=VJMWKfsT4-5-gj8POZFCxaEUO4awTN7zineBjTriNZI,63250
282
282
  Cython/Utility/Dataclasses.c,sha256=eCa9JHHg6bj-WSKw1xTDjazghmXAkMd9J5TnELNTVOI,4023
283
283
  Cython/Utility/Embed.c,sha256=P4JHaSwtj61hRVFgQBKyt3FaNJiBjJe-asLtsFtexGs,3439
284
284
  Cython/Utility/Exceptions.c,sha256=EV8TIZaCdQNo7CPGo6LPQYDYE1a06l2IOwEp6PIHLns,35793
@@ -296,9 +296,9 @@ Cython/Utility/Optimize.c,sha256=AHaZlr8XCp6E2QOBNlUAEIhRUolKp0UyRJxh6jilqjk,599
296
296
  Cython/Utility/Overflow.c,sha256=9C-WIzd4k4uSD7IrLVIJz8fEMK1jFt9UR4WRjDlarYk,15689
297
297
  Cython/Utility/Printing.c,sha256=h3F9eyCXSs284Y8DZRivKtoAOcx5jIYPeNFOSD59foc,2898
298
298
  Cython/Utility/Profile.c,sha256=JPglBHCdnTtyGj0JKzPtfN0djAIe6P5FVAqBQt43RZo,41218
299
- Cython/Utility/StringTools.c,sha256=WQpQTBWSVYpNPUsVj2cXP_RgwcfyQ_NH-T70e65N59U,50848
299
+ Cython/Utility/StringTools.c,sha256=N7tFfz0pGcQdYhMAoUR41gSwX-BcfpQiDJrBCS-I1wM,50852
300
300
  Cython/Utility/Synchronization.c,sha256=B3sJpm2UwNGkjWIeMDF8AqCgtttASNIPRXHvA7kXLKE,18675
301
- Cython/Utility/TString.c,sha256=UM3kg04oc0qq54ciFZd9X6Bk2acO1TqqZo89UtFvaoQ,13893
301
+ Cython/Utility/TString.c,sha256=8cAAcx70pSeYH9Xw98OPmYBUV1LtgwmIFr54Swvuqa0,14001
302
302
  Cython/Utility/TestCyUtilityLoader.pyx,sha256=91lWWJub7l_6xNn3ncrvQZZ94RpkQzEx2NtAaFpvrxY,152
303
303
  Cython/Utility/TestCythonScope.pyx,sha256=mWowHlHIs22w6xC5KAc8kelf2f2n6bhLapyqgz0JMpc,1999
304
304
  Cython/Utility/TestUtilityLoader.c,sha256=dGy6ZWL2kBqtmUY7kF75UEox5kadQZ__BmZKscwg2aY,279
@@ -310,8 +310,8 @@ Cython/Utility/arrayarray.h,sha256=hjXya3s-GoN4mKZTKUlyqPfT3tzf0GiansnSkUcWhk0,4
310
310
  pyximport/__init__.py,sha256=9hOyKolFtOerPiVEyktKrT1VtzbGexq9UmORzo52iHI,79
311
311
  pyximport/pyxbuild.py,sha256=AsL1tyLxG61Mj7Ah-DxtDBuaXF94W2Tb6KTos7r0w8I,5702
312
312
  pyximport/pyximport.py,sha256=BnXVwq1cwo1EYRjPU0J-RUDcwzGjUlzKWZOOMDNcu-s,18510
313
- cython-3.2.2.dist-info/METADATA,sha256=V5NnCFFDPGtyyFd9r4accPayqeK-dptDMeHgB8ulvyg,4746
314
- cython-3.2.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
315
- cython-3.2.2.dist-info/entry_points.txt,sha256=VU8NX8gnQyFbyqiWMzfh9BHvYMuoQRS3Nbm3kKcKQeY,139
316
- cython-3.2.2.dist-info/top_level.txt,sha256=jLV8tZV98iCbIfiJR4DVzTX5Ru1Y_pYMZ59wkMCe6SY,24
317
- cython-3.2.2.dist-info/RECORD,,
313
+ cython-3.2.4.dist-info/METADATA,sha256=4cWxoE3O1NfAYxd-LZo-g_v1WPg5NfLGpXm53cs5v9Y,7282
314
+ cython-3.2.4.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
315
+ cython-3.2.4.dist-info/entry_points.txt,sha256=VU8NX8gnQyFbyqiWMzfh9BHvYMuoQRS3Nbm3kKcKQeY,139
316
+ cython-3.2.4.dist-info/top_level.txt,sha256=jLV8tZV98iCbIfiJR4DVzTX5Ru1Y_pYMZ59wkMCe6SY,24
317
+ cython-3.2.4.dist-info/RECORD,,
@@ -1,103 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: Cython
3
- Version: 3.2.2
4
- Summary: The Cython compiler for writing C extensions in the Python language.
5
- Home-page: https://cython.org/
6
- Author: Robert Bradshaw, Stefan Behnel, David Woods, Greg Ewing, et al.
7
- Author-email: cython-devel@python.org
8
- License: Apache-2.0
9
- Project-URL: Documentation, https://cython.readthedocs.io/
10
- Project-URL: Donate, https://cython.readthedocs.io/en/latest/src/donating.html
11
- Project-URL: Source Code, https://github.com/cython/cython
12
- Project-URL: Bug Tracker, https://github.com/cython/cython/issues/
13
- Project-URL: User Group, https://groups.google.com/g/cython-users
14
- Classifier: Development Status :: 5 - Production/Stable
15
- Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: Apache Software License
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python
19
- Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.8
21
- Classifier: Programming Language :: Python :: 3.9
22
- Classifier: Programming Language :: Python :: 3.10
23
- Classifier: Programming Language :: Python :: 3.11
24
- Classifier: Programming Language :: Python :: 3.12
25
- Classifier: Programming Language :: Python :: 3.13
26
- Classifier: Programming Language :: Python :: 3.14
27
- Classifier: Programming Language :: Python :: Implementation :: CPython
28
- Classifier: Programming Language :: Python :: Implementation :: PyPy
29
- Classifier: Programming Language :: Python :: Implementation :: Stackless
30
- Classifier: Programming Language :: C
31
- Classifier: Programming Language :: C++
32
- Classifier: Programming Language :: Cython
33
- Classifier: Topic :: Software Development :: Code Generators
34
- Classifier: Topic :: Software Development :: Compilers
35
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
36
- Classifier: Typing :: Typed
37
- Requires-Python: >=3.8
38
- Description-Content-Type: text/x-rst
39
-
40
- The Cython language makes writing C extensions for the Python language as
41
- easy as Python itself. Cython is a source code translator based on Pyrex_,
42
- but supports more cutting edge functionality and optimizations.
43
-
44
- The Cython language is a superset of the Python language (almost all Python
45
- code is also valid Cython code), but Cython additionally supports optional
46
- static typing to natively call C functions, operate with C++ classes and
47
- declare fast C types on variables and class attributes. This allows the
48
- compiler to generate very efficient C code from Cython code.
49
-
50
- This makes Cython the ideal language for writing glue code for external
51
- C/C++ libraries, and for fast C modules that speed up the execution of
52
- Python code.
53
-
54
- The newest Cython release can always be downloaded from https://cython.org/.
55
- Unpack the tarball or zip file, enter the directory, and then run::
56
-
57
- pip install .
58
-
59
- Note that for one-time builds, e.g. for CI/testing, on platforms that are not
60
- covered by one of the wheel packages provided on PyPI *and* the pure Python wheel
61
- that we provide is not used, it is substantially faster than a full source build
62
- to install an uncompiled (slower) version of Cython with::
63
-
64
- NO_CYTHON_COMPILE=true pip install .
65
-
66
- .. _Pyrex: https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
67
-
68
- 3.2.2 (2025-11-30)
69
- ==================
70
-
71
- Features added
72
- --------------
73
-
74
- * The C-API declarations were updated to include the new ``PyDict_*Ref()`` functions.
75
- (Github issue https://github.com/cython/cython/issues/7291)
76
-
77
- Bugs fixed
78
- ----------
79
-
80
- * Iteration over literal sequences and strings in generators generated invalid C code since 3.2.0.
81
- This was a regression due to the C array iteration optimisation in https://github.com/cython/cython/issues/6926, which is now
82
- disabled inside of generators.
83
- (Github issue https://github.com/cython/cython/issues/7342)
84
-
85
- * Calling special methods of known exception types failed with an ``AttributeError``.
86
- (Github issue https://github.com/cython/cython/issues/7342)
87
-
88
- * Calling the unbound ``__mul__`` special method of builtin collections with subtypes failed.
89
- (Github issue https://github.com/cython/cython/issues/7340)
90
-
91
- * C string literals could generate invalid "const to non-const" casts in the C code.
92
- (Github issue https://github.com/cython/cython/issues/7346)
93
-
94
- * ``yield`` is no longer allowed inside of a ``cython.critical_section``,
95
- but *is* now allowed while holding a ``cython.pymutex``.
96
- (Github issue https://github.com/cython/cython/issues/7317)
97
-
98
- * Under lock congestion, acquiring the GIL could crash in Python 3.11, part 2.
99
- This bug was introduced in Cython 3.2.0.
100
- (Github issue https://github.com/cython/cython/issues/7312)
101
-
102
- * The new ``py_safe_*`` functions in ``libc.threads`` triggered C compiler warnings.
103
- (Github issue https://github.com/cython/cython/issues/7356)
File without changes