diff options
Diffstat (limited to 'CHANGES.rst')
-rw-r--r-- | CHANGES.rst | 341 |
1 files changed, 322 insertions, 19 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 24cb4e23b..41fdc1aac 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,7 +2,124 @@ Cython Changelog ================ -3.0.0 alpha 11 (2022-0?-??) +3.0.0 alpha 12 (2022-??-??) +=========================== + +Features added +-------------- + +* Cython implemented C functions now propagate exceptions by default, rather than + swallowing them in non-object returning function if the user forgot to add an + ``except`` declaration to the signature. This was a long-standing source of bugs, + but can require adding the ``noexcept`` declaration to existing functions if + exception propagation is really undesired. + (Github issue :issue:`4280`) + +* `PEP-614 <https://peps.python.org/pep-0614/>`_: + decorators can now be arbitrary Python expressions. + (Github issue :issue:`4570`) + +* Bound C methods can now coerce to Python objects. + (Github issue :issue:`4890`) + +* ``reversed()`` can now be used together with C++ iteration. + Patch by Chia-Hsiang Cheng. (Github issue :issue:`5002`) + +* Standard C/C++ atomic operations are now used for memory views, if available. + (Github issue :issue:`4925`) + +* ``cythonize --help`` now also prints information about the supported environment variables. + Patch by Matus Valo. (Github issue :issue:`1711`) + +* Declarations were added for the bit operations in C++20. + Patch by Jonathan Helgert. (Github issue :issue:`4962`) + +Bugs fixed +---------- + +* Generator expressions and comprehensions now look up their outer-most iterable + on creation, as Python does, and not later on start, as they did previously. + (Github issue :issue:`1159`) + +* Iterating over memoryviews in generator expressions could leak a buffer reference. + (Github issue :issue:`4968`) + +* ``__del__`` finaliser methods were not always called if they were only inherited. + (Github issue :issue:`4995`) + +* ``cdef public`` functions declared in .pxd files could use an incorrectly mangled C name. + Patch by EpigeneMax. (Github issue :issue:`2940`) + +* C++ post-increment/-decrement operators were not correctly looked up on declared C++ + classes, thus allowing Cython declarations to be missing for them and incorrect C++ + code to be generated. + Patch by Max Bachmann. (Github issue :issue:`4536`) + +* C++ iteration more safely stores the iterable in temporary variables. + Patch by Xavier. (Github issue :issue:`3828`) + +* C++ references did not work on fused types. + (Github issue :issue:`4717`) + +* Nesting fused types in other fused types could fail to specialise the inner type. + (Github issue :issue:`4725`) + +* The special methods ``__matmul__``, ``__truediv__``, ``__floordiv__`` failed to type + their ``self`` argument. + (Github issue :issue:`5067`) + +* Coverage analysis failed in projects with a separate source subdirectory. + Patch by Sviatoslav Sydorenko and Ruben Vorderman. (Github issue :issue:`3636`) + +* The ``@dataclass`` directive was accidentally inherited by methods and subclasses. + (Github issue :issue:`4953`) + +* Some issues with Cython ``@dataclass`` arguments, hashing and ``repr()`` were resolved. + (Github issue :issue:`4956`) + +* Relative imports failed in compiled ``__init__.py`` package modules. + Patch by Matus Valo. (Github issue :issue:`3442`) + +* Some old usages of the deprecated Python ``imp`` module were replaced with ``importlib``. + Patch by Matus Valo. (Github issue :issue:`4640`) + +* Invalid and misspelled ``cython.*`` module names were not reported as errors. + (Github issue :issue:`4947`) + +* Extended glob paths with ``/**/`` and ``\**\`` failed on Windows. + +* Annotated HTML generation was missing newlines in 3.0.0a11. + (Github issue :issue:`4945`) + +* Some parser issues were resolved. + (Github issue :issue:`4992`) + +* Some C/C++ warnings were resolved. + Patches by Max Bachmann at al. + (Github issues :issue:`5004`, :issue:`5005`, :issue:`5019`, :issue:`5029`) + +* Intel C compilers could complain about unsupported gcc pragmas. + Patch by Ralf Gommers. (Github issue :issue:`5052`) + +* Includes all bug-fixes and features from the 0.29 maintenance branch + up to the :ref:`0.29.33` release. + +Other changes +------------- + +* The undocumented, untested and apparently useless syntax + ``from somemodule cimport class/struct/union somename`` was removed. The type + modifier is not needed here and a plain ``cimport`` of the name will do. + (Github issue :issue:`4904`) + +* The wheel building process was migrated to use the ``cibuildwheel`` tool. + Patch by Thomas Li. (Github issue :issue:`4736`) + +* Wheels now include a compiled parser again, which increases their size a little + but gives about a 10% speed-up when running Cython. + + +3.0.0 alpha 11 (2022-07-31) =========================== Features added @@ -10,24 +127,43 @@ Features added * A new decorator ``@cython.dataclasses.dataclass`` was implemented that provides compile time dataclass generation capabilities to ``cdef`` classes (extension types). - Patch by David Woods. (Github issue :issue:`2903`) + Patch by David Woods. (Github issue :issue:`2903`). ``kw_only`` dataclasses + added by Yury Sokov. (Github issue :issue:`4794`) * Named expressions (PEP 572) aka. assignment expressions (aka. the walrus operator ``:=``) were implemented. Patch by David Woods. (Github issue :issue:`2636`) -* Some C++ library declarations were extended and fixed. - Patches by Max Bachmann, Till Hoffmann, Julien Jerphanion. - (Github issues :issue:`4530`, :issue:`4528`, :issue:`4710`, :issue:`4746`, :issue:`4751`) +* Context managers can be written in parentheses. + Patch by David Woods. (Github issue :issue:`4814`) -* The ``cythonize`` command has a new option ``-M`` to generate ``.dep`` dependency - files for the compilation unit. This can be used by external build tools to track - these dependencies. Already available in Cython :ref:`0.29.27`. - Patch by Evgeni Burovski. (Github issue :issue:`1214`) +* Cython avoids raising ``StopIteration`` in ``__next__`` methods when possible. + Patch by David Woods. (Github issue :issue:`3447`) + +* Some C++ and CPython library declarations were extended and fixed. + Patches by Max Bachmann, Till Hoffmann, Julien Jerphanion, Wenjun Si. + (Github issues :issue:`4530`, :issue:`4528`, :issue:`4710`, :issue:`4746`, + :issue:`4751`, :issue:`4818`, :issue:`4762`, :issue:`4910`) + +* The ``cythonize`` and ``cython`` commands have a new option ``-M`` / ``--depfile`` + to generate ``.dep`` dependency files for the compilation unit. This can be used + by external build tools to track these dependencies. + The ``cythonize`` option was already available in Cython :ref:`0.29.27`. + Patches by Evgeni Burovski and Eli Schwartz. (Github issue :issue:`1214`) * ``cythonize()`` and the corresponding CLI command now regenerate the output files also when they already exist but were generated by a different Cython version. +* Memory views and the internal Cython array type now identify as ``collections.abc.Sequence``. + Patch by David Woods. (Github issue :issue:`4817`) + +* Cython generators and coroutines now identify as ``CO_ASYNC_GENERATOR``, + ``CO_COROUTINE`` and ``CO_GENERATOR`` accordingly. + (Github issue :issue:`4902`) + +* Memory views can use atomic CPU instructions instead of locks in more cases. + Patch by Sam Gross. (Github issue :issue:`4912`) + * The environment variable ``CYTHON_FORCE_REGEN=1`` can be used to force ``cythonize`` to regenerate the output files regardless of modification times and changes. @@ -35,6 +171,10 @@ Features added smaller set of Cython's own modules, which can be used to reduce the package and install size. +* Improvements to ``PyTypeObject`` definitions in pxd wrapping of libpython. + Patch by John Kirkham. (Github issue :issue:`4699`) + + Bugs fixed ---------- @@ -44,16 +184,33 @@ Bugs fixed * Exceptions within for-loops that run over memoryviews could lead to a ref-counting error. Patch by David Woods. (Github issue :issue:`4662`) +* Using memoryview arguments in closures of inner functions could lead to ref-counting errors. + Patch by David Woods. (Github issue :issue:`4798`) + * Several optimised string methods failed to accept ``None`` as arguments to their options. Test patch by Kirill Smelkov. (Github issue :issue:`4737`) +* A regression in 3.0.0a10 was resolved that prevented property setter methods from + having the same name as their value argument. + Patch by David Woods. (Github issue :issue:`4836`) + * Typedefs for the ``bint`` type did not always behave like ``bint``. - Patch by 0dminnimda. (Github issue :issue:`4660`) + Patch by Nathan Manville and 0dminnimda. (Github issue :issue:`4660`) * The return type of a fused function is no longer ignored for function pointers, since it is relevant when passing them e.g. as argument into other fused functions. Patch by David Woods. (Github issue :issue:`4644`) +* The ``__self__`` attribute of fused functions reports its availability correctly + with ``hasattr()``. Patch by David Woods. + (Github issue :issue:`4808`) + +* ``pyximport`` no longer uses the deprecated ``imp`` module. + Patch by Matus Valo. (Github issue :issue:`4560`) + +* ``pyximport`` failed for long filenames on Windows. + Patch by Matti Picus. (Github issue :issue:`4630`) + * The generated C code failed to compile in CPython 3.11a4 and later. (Github issue :issue:`4500`) @@ -65,7 +222,31 @@ Bugs fixed * A work-around for StacklessPython < 3.8 was disabled in Py3.8 and later. (Github issue :issue:`4329`) -* Includes all bug-fixes from the :ref:`0.29.30` release. +* Improve conversion between function pointers with non-identical but + compatible exception specifications. Patches by David Woods. + (Github issues :issue:`4770`, :issue:`4689`) + +* The runtime size check for imported ``PyVarObject`` types was improved + to reduce false positives and adapt to Python 3.11. + Patch by David Woods. (Github issues :issue:`4827`, :issue:`4894`) + +* The generated modules no longer import NumPy internally when using + fused types but no memoryviews. + Patch by David Woods. (Github issue :issue:`4935`) + +* Improve compatibility with forthcoming CPython 3.12 release. + +* Limited API C preprocessor warning is compatible with MSVC. Patch by + Victor Molina Garcia. (Github issue :issue:`4826`) + +* Some C compiler warnings were fixed. + Patch by mwtian. (Github issue :issue:`4831`) + +* The parser allowed some invalid spellings of ``...``. + Patch by 0dminnimda. (Github issue :issue:`4868`) + +* Includes all bug-fixes and features from the 0.29 maintenance branch + up to the :ref:`0.29.32` release. Other changes ------------- @@ -76,9 +257,13 @@ Other changes for users who did not expect ``None`` to be allowed as input. To allow ``None``, use ``typing.Optional`` as in ``func(x: Optional[list])``. ``None`` is also automatically allowed when it is used as default argument, i.e. ``func(x: list = None)``. - Note that, for backwards compatibility reasons, this does not apply when using Cython's - C notation, as in ``func(list x)``. Here, ``None`` is still allowed, as always. - (Github issues :issue:`3883`, :issue:`2696`) + ``int`` and ``float`` are now also recognised in type annotations and restrict the + value type at runtime. They were previously ignored. + Note that, for backwards compatibility reasons, the new behaviour does not apply when using + Cython's C notation, as in ``func(list x)``. Here, ``None`` is still allowed, as always. + Also, the ``annotation_typing`` directive can now be enabled and disabled more finely + within the module. + (Github issues :issue:`3883`, :issue:`2696`, :issue:`4669`, :issue:`4606`, :issue:`4886`) * The compile-time ``DEF`` and ``IF`` statements are deprecated and generate a warning. They should be replaced with normal constants, code generation or C macros. @@ -87,6 +272,10 @@ Other changes * Reusing an extension type attribute name as a method name is now an error. Patch by 0dminnimda. (Github issue :issue:`4661`) +* Improve compatibility between classes pickled in Cython 3.0 and 0.29.x + by accepting MD5, SHA-1 and SHA-256 checksums. + (Github issue :issue:`4680`) + 3.0.0 alpha 10 (2022-01-06) =========================== @@ -977,6 +1166,120 @@ Other changes .. _`PEP-563`: https://www.python.org/dev/peps/pep-0563 .. _`PEP-479`: https://www.python.org/dev/peps/pep-0479 +.. _0.29.33: + +0.29.33 (????-??-??) +==================== + +Features added +-------------- + +* The ``cythonize`` and ``cython`` commands have a new option ``-M`` / ``--depfile`` + to generate ``.dep`` dependency files for the compilation unit. This can be used + by external build tools to track these dependencies. + The ``cythonize`` option was already available in Cython :ref:`0.29.27`. + Patches by Evgeni Burovski and Eli Schwartz. (Github issue :issue:`1214`) + +Bugs fixed +---------- + +* Fixed various compiler warnings. One patch by Lisandro Dalcin. + (Github issues :issue:`4948`, :issue:`5086`) + +* Fixed error when calculating complex powers of negative numbers. + (Github issue :issue:`5014`) + +* Corrected a small mis-formatting of exception messages on Python 2. + (Github issue :issue:`5018`) + +Other changes +------------- + +* The undocumented, untested and apparently useless syntax + ``from somemodule cimport class/struct/union somename`` was deprecated + in anticipation of its removal in Cython 3. The type + modifier is not needed here and a plain ``cimport`` of the name will do. + (Github issue :issue:`4905`) + +* Properly disable generation of descriptor docstrings on PyPy since + they cause crashes. It was previously disabled, but only accidentally + via a typo. Patch by Matti Picus. + (Github issue :issue:`5083`) + + + +.. _0.29.32: + +0.29.32 (2022-07-29) +==================== + +Bugs fixed +---------- + +* Revert "Using memoryview typed arguments in inner functions is now rejected as unsupported." + Patch by David Woods. (Github issue :issue:`4798`) + +* ``from module import *`` failed in 0.29.31 when using memoryviews. + Patch by David Woods. (Github issue :issue:`4927`) + + +.. _0.29.31: + +0.29.31 (2022-07-27) +==================== + +Features added +-------------- + +* A new argument ``--module-name`` was added to the ``cython`` command to + provide the (one) exact target module name from the command line. + Patch by Matthew Brett and h-vetinari. (Github issue :issue:`4906`) + +Bugs fixed +---------- + +* Use ``importlib.util.find_spec()`` instead of the deprecated ``importlib.find_loader()`` + function when setting up the package path at import-time. + Patch by Matti Picus. (Github issue :issue:`4764`) + +* Require the C compiler to support the two-arg form of ``va_start`` + on Python 3.10 and higher. + Patch by Thomas Caswell. (Github issue :issue:`4820`) + +* Make ``fused_type`` subscriptable in Shadow.py. + Patch by Pfebrer. (Github issue :issue:`4842`) + +* Fix the incorrect code generation of the target type in ``bytearray`` loops. + Patch by Kenrick Everett. (Github issue :issue:`4108`) + +* Atomic refcounts for memoryviews were not used on some GCC versions by accident. + Patch by Sam Gross. (Github issue :issue:`4915`) + +* Silence some GCC ``-Wconversion`` warnings in C utility code. + Patch by Lisandro Dalcin. (Github issue :issue:`4854`) + +* Tuple multiplication was ignored in expressions such as ``[*(1,) * 2]``. + Patch by David Woods. (Github issue :issue:`4864`) + +* Calling ``append`` methods on extension types could fail to find the method + in some cases. + Patch by David Woods. (Github issue :issue:`4828`) + +* Ensure that object buffers (e.g. ``ndarray[object, ndim=1]``) containing + ``NULL`` pointers are safe to use, returning ``None`` instead of the ``NULL`` + pointer. + Patch by Sebastian Berg. (Github issue :issue:`4859`) + +* Using memoryview typed arguments in inner functions is now rejected as unsupported. + Patch by David Woods. (Github issue :issue:`4798`) + +* Compilation could fail on systems (e.g. FIPS) that block MD5 checksums at runtime. + (Github issue :issue:`4909`) + +* Experimental adaptations for the CPython "nogil" fork was added. + Note that there is no official support for this in Cython 0.x. + Patch by Sam Gross. (Github issue :issue:`4912`) + .. _0.29.30: @@ -988,7 +1291,7 @@ Bugs fixed * The GIL handling changes in 0.29.29 introduced a regression where objects could be deallocated without holding the GIL. - (Github issue :issue`4796`) + (Github issue :issue:`4796`) .. _0.29.29: @@ -1002,7 +1305,7 @@ Features added * Avoid acquiring the GIL at the end of nogil functions. This change was backported in order to avoid generating wrong C code that would trigger C compiler warnings with tracing support enabled. - Backport by Oleksandr Pavlyk. (Github issue :issue`4637`) + Backport by Oleksandr Pavlyk. (Github issue :issue:`4637`) Bugs fixed ---------- @@ -1018,15 +1321,15 @@ Bugs fixed * Cython now correctly generates Python methods for both the provided regular and reversed special numeric methods of extension types. - Patch by David Woods. (Github issue :issue`4750`) + Patch by David Woods. (Github issue :issue:`4750`) * Calling unbound extension type methods without arguments could raise an ``IndexError`` instead of a ``TypeError``. - Patch by David Woods. (Github issue :issue`4779`) + Patch by David Woods. (Github issue :issue:`4779`) * Calling unbound ``.__contains__()`` super class methods on some builtin base types could trigger an infinite recursion. - Patch by David Woods. (Github issue :issue`4785`) + Patch by David Woods. (Github issue :issue:`4785`) * The C union type in pure Python mode mishandled some field names. Patch by Jordan Brière. (Github issue :issue:`4727`) |