unstale

pypi / cython

cython

What changed in cython 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-13.

2 breaking1 security6 new APIs and options5 performance11 behavior and defaults1 tooling12 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.0 on npm

cython 338 changes

Breaking changes 2

  • Unpickling object pickle data with instance dict state into an object that has no __dict__ is now an error.

    3.2.0release notes

  • Instantiating internal types used by Cython is now prohibited.

    3.2.0release notes

Security 1

  • Expressions use a slightly safer scheme when unpacking Python integers.

    3.1.5release notes

New APIs and options 6

  • Declarations for C++ condition variables were added.

    3.2.0release notes

  • The new --embed-modules option lists extension modules to statically link into the generated extension module so they are initialised on application start.

    3.2.0release notes

  • The C macro configures whether some object constants are marked immortal to speed reference counting in recent CPython versions.

    3.2.0release notes

  • Some GIL-safe C-API wrappers were added to the libc and libcpp declarations.

    3.2.0release notes

  • Cython's setup.py now accepts the desired Limited API version through --cython-limited-api.

    3.2.0release notes

  • T-strings are implemented according to PEP-750, backporting the template classes while preferring separately installed backports.

    3.2.0release notes

Performance 5

  • bool(c_int), bool(c_float) and bool(c_ptr) avoid passing through Python objects.

    3.2.0release notes

  • Runtime Python dispatch for fused functions is substantially faster.

    3.2.0release notes

  • Looping over literal sequences and strings now uses efficient C array looping when possible.

    3.2.0release notes

  • Imports quickly check whether a module is already imported, speeding up reimports.

    3.2.0release notes

  • Type checks on union types such as int | None are optimised into separate checks.

    3.2.0release notes

Behavior and default changes 11

  • Some lesser-used platforms now use Python 3.9 abi3 wheels instead of Python-version-specific wheels; an abi3 wheel was also added for armv7l.

    3.2.0release notes

  • Builtin exception types are now inferred.

    3.2.0release notes

  • Mixed operations use less code and are more streamlined for Python 3.12 and later.

    3.2.0release notes

  • F-string syntax was extended according to PEP-701.

    3.2.0release notes

  • Assignments accept any suitable Python number and automatically convert it to a Python float.

    3.2.0release notes

  • Freelists are now used with the Limited API and extension type specs, including freelists declared with a cdef class decorator and internally used types.

    3.2.0release notes

  • NaN is now supported as an exception return value.

    3.2.0release notes

  • Variables assigned inside prange loops can now be initialised outside the loop.

    3.2.0release notes

  • The known, inferred and optimised builtin list changed: range is now considered a type, and ascii, bin, format, hex and oct are added as functions.

    3.2.0release notes

  • Unknown return type annotations using -> now produce warnings instead of being rejected; -> None is also allowed.

    3.2.0release notes

  • Unicode 16.0.0 is now used to parse identifiers.

    3.2.0release notes

Tooling 1

  • Cython tools and frontend scripts now use python3 instead of python in their shebang line.

    3.2.0release notes

Fixes and other changes 12

  • Fixed cases where indexing bytes failed to optimise.

    3.2.0release notes

  • cython.critical_section now works with PyMutex, as it already did with Python objects.

    3.2.0release notes

  • Extension arguments defined for the shared code module are no longer ignored.

    3.2.0release notes

  • Fixed embedsignatures failing when lambda was used in function default arguments.

    3.2.0release notes

  • Several improvements were made in freethreaded Python code.

    3.2.0release notes

  • Several improvements were made for the Limited API.

    3.2.0release notes

  • Fixed a crash when iterating over temporary memoryviews.

    3.2.0release notes

  • Fixed an incorrect call to PyList_GetItemRef in PyPy and GraalPython before Python 3.13.

    3.2.0release notes

  • Value conversion errors no longer fail tracing C return statements; tracing falls back to reporting None returns.

    3.1.5release notes

  • Conversion now validates the length of C++ strings longer than PY_SSIZE_T_MAX.

    3.1.5release notes

  • Generated header files no longer use some non-Limited API code.

    3.1.5release notes

  • Empty return statements are now reported consistently when tracing.

    3.1.5release notes