Cython

Latest version: v3.0.11

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 17

0.29.21

====================

Bugs fixed
----------

* Fix a regression in 0.29.20 where ``__div__`` failed to be found in extension types.
(Github issue :issue:`3688`)

* Fix a regression in 0.29.20 where a call inside of a finally clause could fail to compile.
Patch by David Woods. (Github issue :issue:`3712`)

* Zero-sized buffers could fail to validate as C/Fortran-contiguous.
Patch by Clemens Hofreither. (Github issue :issue:`2093`)

* ``exec()`` did not allow recent Python syntax features in Py3.8+ due to
https://bugs.python.org/issue35975.
(Github issue :issue:`3695`)

* Binding staticmethods of Cython functions were not behaving like Python methods in Py3.
Patch by Jeroen Demeyer and Michał Górny. (Github issue :issue:`3106`)

* Pythran calls to NumPy methods no longer generate useless method lookup code.

* The ``PyUnicode_GET_LENGTH()`` macro was missing from the ``cpython.*`` declarations.
Patch by Thomas Caswell. (Github issue :issue:`3692`)

* The deprecated ``PyUnicode_*()`` C-API functions are no longer used, except for Unicode
strings that contain lone surrogates. Unicode strings that contain non-BMP characters
or surrogate pairs now generate different C code on 16-bit Python 2.x Unicode deployments
(such as MS-Windows). Generating the C code on Python 3.x is recommended in this case.
Original patches by Inada Naoki and Victor Stinner.
(Github issues :issue:`3677`, :issue:`3721`, :issue:`3697`)

* Some template parameters were missing from the C++ ``std::unordered_map`` declaration.
Patch by will. (Github issue :issue:`3685`)

* Several internal code generation issues regarding temporary variables were resolved.
(Github issue :issue:`3708`)

0.29.20

====================

Bugs fixed
----------

* Nested try-except statements with multiple ``return`` statements could crash
due to incorrect deletion of the ``except as`` target variable.
(Github issue :issue:`3666`)

* The ``classmethod`` decorator no longer rejects unknown input from other decorators.
Patch by David Woods. (Github issue :issue:`3660`)

* Fused types could leak into unrelated usages.
Patch by David Woods. (Github issue :issue:`3642`)

* Now uses ``Py_SET_SIZE()`` and ``Py_SET_REFCNT()`` in Py3.9+ to avoid low-level
write access to these object fields.
Patch by Victor Stinner. (Github issue :issue:`3639`)

* The built-in ``abs()`` function could lead to undefined behaviour when used on
the negative-most value of a signed C integer type.
Patch by Serge Guelton. (Github issue :issue:`1911`)

* Usages of ``sizeof()`` and ``typeid()`` on uninitialised variables no longer
produce a warning.
Patch by Celelibi. (Github issue :issue:`3575`)

* The C++ ``typeid()`` function was allowed in C mode.
Patch by Celelibi. (Github issue :issue:`3637`)

* The error position reported for errors found in f-strings was misleading.
(Github issue :issue:`3674`)

* The new ``c_api_binop_methods`` directive was added for forward compatibility, but can
only be set to True (the current default value). It can be disabled in Cython 3.0.

0.29.19

====================

Bugs fixed
----------

* A typo in Windows specific code in 0.29.18 was fixed that broke "libc.math".
(Github issue :issue:`3622`)

* A platform specific test failure in 0.29.18 was fixed.
Patch by smutch. (Github issue :issue:`3620`)

0.29.18

====================

Bugs fixed
----------

* Exception position reporting could run into race conditions on threaded code.
It now uses function-local variables again.

* Error handling early in the module init code could lead to a crash.

* Error handling in ``cython.array`` creation was improved to avoid calling
C-API functions with an error held.

* A memory corruption was fixed when garbage collection was triggered during calls
to ``PyType_Ready()`` of extension type subclasses.
(Github issue :issue:`3603`)

* Memory view slicing generated unused error handling code which could negatively
impact the C compiler optimisations for parallel OpenMP code etc. Also, it is
now helped by static branch hints.
(Github issue :issue:`2987`)

* Cython's built-in OpenMP functions were not translated inside of call arguments.
Original patch by Celelibi and David Woods. (Github issue :issue:`3594`)

* Complex buffer item types of structs of arrays could fail to validate.
Patch by Leo and smutch. (Github issue :issue:`1407`)

* Decorators were not allowed on nested `async def` functions.
(Github issue :issue:`1462`)

* C-tuples could use invalid C struct casting.
Patch by MegaIng. (Github issue :issue:`3038`)

* Optimised ``%d`` string formatting into f-strings failed on float values.
(Github issue :issue:`3092`)

* Optimised aligned string formatting (``%05s``, ``%-5s``) failed.
(Github issue :issue:`3476`)

* When importing the old Cython ``build_ext`` integration with distutils, the
additional command line arguments leaked into the regular command.
Patch by Kamekameha. (Github issue :issue:`2209`)

* When using the ``CYTHON_NO_PYINIT_EXPORT`` option in C++, the module init function
was not declared as ``extern "C"``.
(Github issue :issue:`3414`)

* Three missing timedelta access macros were added in ``cpython.datetime``.

* The signature of the NumPy C-API function ``PyArray_SearchSorted()`` was fixed.
Patch by Brock Mendel. (Github issue :issue:`3606`)

0.29.17

====================

Features added
--------------

* ``std::move()`` is now available from ``libcpp.utility``.
Patch by Omer Ozarslan. (Github issue :issue:`2169`)

* The ``cython.binding`` decorator is available in Python code.
(Github issue :issue:`3505`)

Bugs fixed
----------

* Creating an empty unicode slice with large bounds could crash.
Patch by Sam Sneddon. (Github issue :issue:`3531`)

* Decoding an empty bytes/char* slice with large bounds could crash.
Patch by Sam Sneddon. (Github issue :issue:`3534`)

* Re-importing a Cython extension no longer raises the error
"``__reduce_cython__ not found``".
(Github issue :issue:`3545`)

* Unused C-tuples could generate incorrect code in 0.29.16.
Patch by Kirk Meyer. (Github issue :issue:`3543`)

* Creating a fused function attached it to the garbage collector before it
was fully initialised, thus risking crashes in rare failure cases.
Original patch by achernomorov. (Github issue :issue:`3215`)

* Temporary buffer indexing variables were not released and could show up in
C compiler warnings, e.g. in generators.
Patch by David Woods. (Github issues :issue:`3430`, :issue:`3522`)

* The compilation cache in ``cython.inline("…")`` failed to take the language
level into account.
Patch by will-ca. (Github issue :issue:`3419`)

* The deprecated ``PyUnicode_GET_SIZE()`` function is no longer used in Py3.

0.29.16

====================

Bugs fixed
----------

* Temporary internal variables in nested prange loops could leak into other
threads. Patch by Frank Schlimbach. (Github issue :issue:`3348`)

* Default arguments on fused functions could crash.
Patch by David Woods. (Github issue :issue:`3370`)

* C-tuples declared in ``.pxd`` files could generate incomplete C code.
Patch by Kirk Meyer. (Github issue :issue:`1427`)

* Fused functions were not always detected and optimised as Cython
implemented functions.
Patch by David Woods. (Github issue :issue:`3384`)

* Valid Python object concatenation of (iterable) strings to non-strings
could fail with an exception.
Patch by David Woods. (Github issue :issue:`3433`)

* Using C functions as temporary values lead to invalid C code.
Original patch by David Woods. (Github issue :issue:`3418`)

* Fix an unhandled C++ exception in comparisons.
Patch by David Woods. (Github issue :issue:`3361`)

* Fix deprecated import of "imp" module.
Patch by Matti Picus. (Github issue :issue:`3350`)

* Fix compatibility with Pythran 0.9.6 and later.
Patch by Serge Guelton. (Github issue :issue:`3308`)

* The ``_Py_PyAtExit()`` function in ``cpython.pylifecycle`` was misdeclared.
Patch by Zackery Spytz. (Github issue :issue:`3382`)

* Several missing declarations in ``cpython.*`` were added.
Patches by Zackery Spytz. (Github issue :issue:`3452`, :issue:`3421`, :issue:`3411`, :issue:`3402`)

* A declaration for ``libc.math.fpclassify()`` was added.
Patch by Zackery Spytz. (Github issue :issue:`2514`)

* Avoid "undeclared" warning about automatically generated pickle methods.
Patch by David Woods. (Github issue :issue:`3353`)

* Avoid C compiler warning about unreachable code in ``prange()``.

* Some C compiler warnings in PyPy were resolved.
Patch by Matti Picus. (Github issue :issue:`3437`)

Page 6 of 17

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.