cython breaking changes
Updated December 4, 2026
On this page
Latest version 3.3.2, released November 25, 2026. Source repository
Its 3.0.0 release drops Python 2.6. Python end of life dates.
- From 0.29 to 3.0.0: 259 breaking changes in 1 version.
- From 0.28 to 3.0.0: 317 breaking changes in 2 versions.
cython 3.0.0 breaking changes
- Removed
Pyston V1 is no longer supported; Pyston V2 is the supported version. github.com - Removed
Cython no longer supports Python 2.6. github.com - Removed
cpdef
Declaring variables with cpdef is no longer allowed, so such code must be changed. github.com - Removed
from somemodule cimport class.struct.union somename
The undocumented syntax with a type modifier was removed; use a plain cimport of the name. github.com - Removed
np.long_t
The np.long_t alias was removed from the NumPy declarations; code using it must change. github.com - Removed
np.ulong_t
The np.ulong_t alias was removed from the NumPy declarations; code using it must change. github.com - Removed
numpy.pxd
Deprecated NumPy API usages were removed from the numpy.pxd declarations. github.com - Removed
python_*
The long deprecated include files were removed from Cython/Includes/Deprecated. Use the libc.* and cpython.* pxd modules instead. github.com - Removed
stdio
The long deprecated include files were removed from Cython/Includes/Deprecated. Use the libc.* and cpython.* pxd modules instead. github.com - Removed
stdlib
The long deprecated include files were removed from Cython/Includes/Deprecated. Use the libc.* and cpython.* pxd modules instead. github.com - Removed
stl
The long deprecated include files were removed from Cython/Includes/Deprecated. Use the libc.* and cpython.* pxd modules instead. github.com - Behavior changed
Cython 3.0.0 release github.com - Behavior changed
Functions without an except declaration now propagate exceptions; add noexcept to keep old non-propagating behavior. github.com - Behavior changed
Annotations are no longer parsed and are kept as strings following PEP 563. github.com - Behavior changed
Arguments annotated with list or extension types no longer allow None; use typing.Optional or a None default. github.com - Behavior changed
Such functions now accept keyword arguments; use the always_allow_keywords(False) directive to reject them. github.com - Behavior changed
Reusing an extension type attribute name as a method name is now a compile error. github.com - Behavior changed
The C property feature was rewritten; C property methods must now be declared inline. github.com - Behavior changed
Tuple types like (int, int) are rejected in Python annotations; use the Python tuple notation instead. github.com - Behavior changed
Using a variable before its declaration now fails to compile, so such code must be reordered. github.com - Behavior changed
Subscripting with integer keys now uses the Mapping protocol before the Sequence protocol, matching Python semantics. github.com - Behavior changed
Python classes without an explicit base are now new-style classes in Python 2 too. github.com - Behavior changed
The cython command line parser was rewritten, so option handling may differ from before. github.com - Behavior changed
Cython now refuses to overwrite output files it did not generate, so wrapper module names may need changing. github.com - Behavior changed
The code except +nogil is rejected as a likely typo for except + nogil; fix the spelling. github.com - Behavior changed
__add__
Binary operator methods now follow Python's reflected-operator rules; the c_api_binop_methods directive restores the old behavior. github.com - Behavior changed
__qualname__
Classes compiled for Python 2.x no longer get a __qualname__ attribute. github.com - Behavior changed
cython --version
The version output moved from stderr to stdout, so scripts reading stderr will see a change. github.com - Behavior changed
Cython.Build.BuildExecutable
The built program is no longer executed automatically; use cythonrun to run it. github.com - Behavior changed
generator_stop
Generator StopIteration handling follows PEP 479 by default under language level 3. Code relying on the old behaviour must change. github.com - Behavior changed
len
len(memoryview), len(char*) and len(Py_UNICODE*) now return a signed Py_ssize_t instead of an unsigned size_t. github.com - Behavior changed
returns
For suitable C return types without @exceptval(), exceptions are now propagated by default. github.com - Default changed
language_level
Code without an explicit language level now gets Python 3 semantics with str literals. Set the language_level=2 directive to keep the previous behaviour. github.com - Configuration changed
Include files are now searched in sys.path before Cython's own Includes directory, so third-party pxd files can override Cython's. github.com - Signature changed
Cython.Build.build_ext
Was class old_build_ext(_build_ext.build_ext); now class build_ext(_build_ext, object). pypi.org - Signature changed
Cython.Build.cythonize
Was def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, force=None, language=None, exclude_failures=False, **options); now def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False... pypi.org - Signature changed
Cython.Build.Cythonize.cythonize
Was def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, force=None, language=None, exclude_failures=False, **options); now def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False... pypi.org - Signature changed
Cython.Build.Dependencies.Context.find_include_file
Was def find_include_file(self, filename, pos); now def find_include_file(self, filename, pos=None, source_file_path=None). pypi.org - Signature changed
Cython.Build.Dependencies.Context.find_pxd_file
Was def find_pxd_file(self, qualified_name, pos, sys_path=True); now def find_pxd_file(self, qualified_name, pos=None, sys_path=True, source_file_path=None). pypi.org - Signature changed
Cython.Build.Dependencies.Context.find_pyx_file
Was def find_pyx_file(self, qualified_name, pos); now def find_pyx_file(self, qualified_name, pos=None, source_file_path=None). pypi.org - Signature changed
Cython.Build.Dependencies.Context.find_submodule
Was def find_submodule(self, name); now def find_submodule(self, name, as_package=False). pypi.org - Signature changed
Cython.Build.Dependencies.Context.search_include_directories
Was def search_include_directories(self, qualified_name, suffix, pos, include=False, sys_path=False); now def search_include_directories(self, qualified_name, suffix=None, source_pos=None, include=False, sys_path=False... pypi.org - Signature changed
Cython.Build.Dependencies.cythonize
Was def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, force=None, language=None, exclude_failures=False, **options); now def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False... pypi.org - Signature changed
Cython.Build.Dependencies.cythonize_one
Was def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None, raise_on_failure=True, embedded_metadata=None, full_module_name=None, progress=''); now def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None... pypi.org - Signature changed
Cython.Build.Distutils.build_ext
Was class old_build_ext(_build_ext.build_ext); now class build_ext(_build_ext, object). pypi.org - Signature changed
Cython.Build.Inline.cythonize
Was def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, force=None, language=None, exclude_failures=False, **options); now def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False... pypi.org - Signature changed
Cython.Build.IpythonMagic.cythonize
Was def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, force=None, language=None, exclude_failures=False, **options); now def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False... pypi.org - Signature changed
Cython.CodeWriter.AsyncIteratorNode
Was class AsyncIteratorNode(ExprNode); now class AsyncIteratorNode(ScopedExprNode). pypi.org - Signature changed
Cython.CodeWriter.CodeWriter
Was class CodeWriter(DeclarationWriter); now class CodeWriter(StatementWriter, ExpressionWriter). pypi.org - Signature changed
Cython.CodeWriter.GeneratorExpressionNode.__init__
Was def __init__(self, pos, **kw); now def __init__(self, pos, *args, **kwds). pypi.org
And 209 more in this version. Sign up to see every change
cython 0.29 breaking changes
- Behavior changed
Cython now emits a warning when no language_level (2, 3 or '3str') is set explicitly, and the default is planned to change in the next major release. Set language_level explicitly to avoid surprises. github.com - Behavior changed
Raising exceptions from nogil code now automatically acquires the GIL instead of requiring an explicit with gil block. github.com - Behavior changed
When PEP-489 support is enabled, reloading a module now raises an exception instead of overwriting static module state. github.com - Behavior changed
Generated modules no longer warn on import when the NumPy array type is larger than at compile time. github.com - Behavior changed
Exception handling in generators and coroutines under CPython 3.7 was adapted, which changes error reporting and tracebacks for users of 0.28. github.com - Signature changed
Cython.Build.Dependencies.Context.__init__
Was def __init__(self, include_directories, compiler_directives, cpp=False, language_level=2, options=None, create_testscope=True); now def __init__(self, include_directories, compiler_directives, cpp=False, language_level=None... pypi.org - Signature changed
Cython.Build.Dependencies.DependencyTree.transitive_fingerprint
Was def transitive_fingerprint(self, filename, extra=None); now def transitive_fingerprint(self, filename, module, compilation_options). pypi.org - Signature changed
Cython.Build.Inline.Context.__init__
Was def __init__(self, include_directories, compiler_directives, cpp=False, language_level=2, options=None, create_testscope=True); now def __init__(self, include_directories, compiler_directives, cpp=False, language_level=None... pypi.org - Signature changed
Cython.Build.Inline.cython_inline
Was def cython_inline(code, get_type=unsafe_type, lib_dir=os.path.join(get_cython_cache_dir(), 'inline'), cython_include_dirs=None, force=False, quiet=False, locals=None, globals=None, **kwds); now def cython_inline(code... pypi.org - Signature changed
Cython.Build.IpythonMagic.cython_inline
Was def cython_inline(code, get_type=unsafe_type, lib_dir=os.path.join(get_cython_cache_dir(), 'inline'), cython_include_dirs=None, force=False, quiet=False, locals=None, globals=None, **kwds); now def cython_inline(code... pypi.org
And 48 more in this version. Sign up to see every change
cython 0.28 breaking changes
- Behavior changed
__richcmp__
The first argument of __richcmp__ is now recognised as self with its correct type, which can change code that relied on it being untyped. github.com - Signature changed
Cython.Build.Dependencies.cythonize_one
Was def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None, raise_on_failure=True, embedded_metadata=None, progress=''); now def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None, raise_on_failure=True... pypi.org - Signature changed
Cython.CodeWriter.analyse_type_annotation
Was def analyse_type_annotation(annotation, env); now def analyse_type_annotation(annotation, env, assigned_value=None). pypi.org - Signature changed
Cython.CodeWriter.BoolBinopNode.generate_bool_evaluation_code
Was def generate_bool_evaluation_code(self, code, final_result_temp, and_label, or_label, end_label, fall_through); now def generate_bool_evaluation_code(self, code, final_result_temp, final_result_type, and_label, or_label, end_label... pypi.org - Signature changed
Cython.CodeWriter.BoolBinopResultNode.generate_bool_evaluation_code
Was def generate_bool_evaluation_code(self, code, final_result_temp, and_label, or_label, end_label, fall_through); now def generate_bool_evaluation_code(self, code, final_result_temp, final_result_type, and_label, or_label, end_label... pypi.org - Signature changed
Cython.Compiler.Buffer.ModuleNode.generate_includes
Was def generate_includes(self, env, cimported_modules, code); now def generate_includes(self, env, cimported_modules, code, early=True, late=True). pypi.org - Signature changed
Cython.Compiler.Buffer.ModuleNode.generate_type_ready_code
Was def generate_type_ready_code(self, env, entry, code); now def generate_type_ready_code(self, entry, code). pypi.org - Signature changed
Cython.Compiler.Builtin.StructOrUnionScope.declare_var
Was def declare_var(self, name, type, pos, cname=None, visibility='private', api=0, in_pxd=0, is_cdef=0, allow_pyobject=0); now def declare_var(self, name, type, pos, cname=None, visibility='private', api=0, in_pxd=0, is_cdef=0... pypi.org - Signature changed
Cython.Compiler.Code.GlobalState.get_cached_unbound_method
Was def get_cached_unbound_method(self, type_cname, method_name, args_count); now def get_cached_unbound_method(self, type_cname, method_name). pypi.org - Signature changed
Cython.Compiler.CythonScope.CEnumType
Was class CEnumType(CType); now class CEnumType(CIntLike, CType). pypi.org
And 42 more in this version. Sign up to see every change
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.