Blame CHANGES.rst

Packit 562c7a
================
Packit 562c7a
Cython Changelog
Packit 562c7a
================
Packit 562c7a
Packit 562c7a
0.28.1 (2018-03-18)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* ``PyFrozenSet_New()`` was accidentally used in PyPy where it is missing
Packit 562c7a
  from the C-API.
Packit 562c7a
Packit 562c7a
* Assignment between some C++ templated types were incorrectly rejected
Packit 562c7a
  when the templates mix ``const`` with ``ctypedef``.
Packit 562c7a
  (Github issue #2148)
Packit 562c7a
Packit 562c7a
* Undeclared C++ no-args constructors in subclasses could make the compilation
Packit 562c7a
  fail if the base class constructor was declared without ``nogil``.
Packit 562c7a
  (Github issue #2157)
Packit 562c7a
Packit 562c7a
* Bytes %-formatting inferred ``basestring`` (bytes or unicode) as result type
Packit 562c7a
  in some cases where ``bytes`` would have been safe to infer.
Packit 562c7a
  (Github issue #2153)
Packit 562c7a
Packit 562c7a
* ``None`` was accidentally disallowed as typed return value of ``dict.pop()``.
Packit 562c7a
  (Github issue #2152)
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.28 (2018-03-13)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Cdef classes can now multiply inherit from ordinary Python classes.
Packit 562c7a
  (The primary base must still be a c class, possibly ``object``, and
Packit 562c7a
  the other bases must *not* be cdef classes.)
Packit 562c7a
Packit 562c7a
* Type inference is now supported for Pythran compiled NumPy expressions.
Packit 562c7a
  Patch by Nils Braun.  (Github issue #1954)
Packit 562c7a
Packit 562c7a
* The ``const`` modifier can be applied to memoryview declarations to allow
Packit 562c7a
  read-only buffers as input.  (Github issues #1605, #1869)
Packit 562c7a
Packit 562c7a
* C code in the docstring of a ``cdef extern`` block is copied verbatimly
Packit 562c7a
  into the generated file.
Packit 562c7a
  Patch by Jeroen Demeyer.  (Github issue #1915)
Packit 562c7a
Packit 562c7a
* When compiling with gcc, the module init function is now tuned for small
Packit 562c7a
  code size instead of whatever compile flags were provided externally.
Packit 562c7a
  Cython now also disables some code intensive optimisations in that function
Packit 562c7a
  to further reduce the code size.  (Github issue #2102)
Packit 562c7a
Packit 562c7a
* Decorating an async coroutine with ``@cython.iterable_coroutine`` changes its
Packit 562c7a
  type at compile time to make it iterable.  While this is not strictly in line
Packit 562c7a
  with PEP-492, it improves the interoperability with old-style coroutines that
Packit 562c7a
  use ``yield from`` instead of ``await``.
Packit 562c7a
Packit 562c7a
* The IPython magic has preliminary support for JupyterLab.
Packit 562c7a
  (Github issue #1775)
Packit 562c7a
Packit 562c7a
* The new TSS C-API in CPython 3.7 is supported and has been backported.
Packit 562c7a
  Patch by Naotoshi Seo.  (Github issue #1932)
Packit 562c7a
Packit 562c7a
* Cython knows the new ``Py_tss_t`` type defined in PEP-539 and automatically
Packit 562c7a
  initialises variables declared with that type to ``Py_tss_NEEDS_INIT``,
Packit 562c7a
  a value which cannot be used outside of static assignments.
Packit 562c7a
Packit 562c7a
* The set methods ``.remove()`` and ``.discard()`` are optimised.
Packit 562c7a
  Patch by Antoine Pitrou.  (Github issue #2042)
Packit 562c7a
Packit 562c7a
* ``dict.pop()`` is optimised.
Packit 562c7a
  Original patch by Antoine Pitrou.  (Github issue #2047)
Packit 562c7a
Packit 562c7a
* Iteration over sets and frozensets is optimised.
Packit 562c7a
  (Github issue #2048)
Packit 562c7a
Packit 562c7a
* Safe integer loops (< range(2^30)) are automatically optimised into C loops.
Packit 562c7a
Packit 562c7a
* ``alist.extend([a,b,c])`` is optimised into sequential ``list.append()`` calls
Packit 562c7a
  for short literal sequences.
Packit 562c7a
Packit 562c7a
* Calls to builtin methods that are not specifically optimised into C-API calls
Packit 562c7a
  now use a cache that avoids repeated lookups of the underlying C function.
Packit 562c7a
  (Github issue #2054)
Packit 562c7a
Packit 562c7a
* Single argument function calls can avoid the argument tuple creation in some cases.
Packit 562c7a
Packit 562c7a
* Some redundant extension type checks are avoided.
Packit 562c7a
Packit 562c7a
* Formatting C enum values in f-strings is faster, as well as some other special cases.
Packit 562c7a
Packit 562c7a
* String formatting with the '%' operator is optimised into f-strings in simple cases.
Packit 562c7a
Packit 562c7a
* Subscripting (item access) is faster in some cases.
Packit 562c7a
Packit 562c7a
* Some ``bytearray`` operations have been optimised similar to ``bytes``.
Packit 562c7a
Packit 562c7a
* Some PEP-484/526 container type declarations are now considered for
Packit 562c7a
  loop optimisations.
Packit 562c7a
Packit 562c7a
* Indexing into memoryview slices with ``view[i][j]`` is now optimised into
Packit 562c7a
  ``view[i, j]``.
Packit 562c7a
Packit 562c7a
* Python compatible ``cython.*`` types can now be mixed with type declarations
Packit 562c7a
  in Cython syntax.
Packit 562c7a
Packit 562c7a
* Name lookups in the module and in classes are faster.
Packit 562c7a
Packit 562c7a
* Python attribute lookups on extension types without instance dict are faster.
Packit 562c7a
Packit 562c7a
* Some missing signals were added to ``libc/signal.pxd``.
Packit 562c7a
  Patch by Jeroen Demeyer.  (Github issue #1914)
Packit 562c7a
Packit 562c7a
* The warning about repeated extern declarations is now visible by default.
Packit 562c7a
  (Github issue #1874)
Packit 562c7a
Packit 562c7a
* The exception handling of the function types used by CPython's type slot
Packit 562c7a
  functions was corrected to match the de-facto standard behaviour, so that
Packit 562c7a
  code that uses them directly benefits from automatic and correct exception
Packit 562c7a
  propagation.  Patch by Jeroen Demeyer.  (Github issue #1980)
Packit 562c7a
Packit 562c7a
* Defining the macro ``CYTHON_NO_PYINIT_EXPORT`` will prevent the module init
Packit 562c7a
  function from being exported as symbol, e.g. when linking modules statically
Packit 562c7a
  in an embedding setup.  Patch by AraHaan.  (Github issue #1944)
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* If a module name is explicitly provided for an ``Extension()`` that is compiled
Packit 562c7a
  via ``cythonize()``, it was previously ignored and replaced by the source file
Packit 562c7a
  name.  It can now be used to override the target module name, e.g. for compiling
Packit 562c7a
  prefixed accelerator modules from Python files.  (Github issue #2038)
Packit 562c7a
Packit 562c7a
* The arguments of the ``num_threads`` parameter of parallel sections
Packit 562c7a
  were not sufficiently validated and could lead to invalid C code.
Packit 562c7a
  (Github issue #1957)
Packit 562c7a
Packit 562c7a
* Catching exceptions with a non-trivial exception pattern could call into
Packit 562c7a
  CPython with a live exception set.  This triggered incorrect behaviour
Packit 562c7a
  and crashes, especially in CPython 3.7.
Packit 562c7a
Packit 562c7a
* The signature of the special ``__richcmp__()`` method was corrected to recognise
Packit 562c7a
  the type of the first argument as ``self``.  It was previously treated as plain
Packit 562c7a
  object, but CPython actually guarantees that it always has the correct type.
Packit 562c7a
  Note: this can change the semantics of user code that previously relied on
Packit 562c7a
  ``self`` being untyped.
Packit 562c7a
Packit 562c7a
* Some Python 3 exceptions were not recognised as builtins when running Cython
Packit 562c7a
  under Python 2.
Packit 562c7a
Packit 562c7a
* Some async helper functions were not defined in the generated C code when
Packit 562c7a
  compiling simple async code.  (Github issue #2075)
Packit 562c7a
Packit 562c7a
* Line tracing did not include generators and coroutines.
Packit 562c7a
  (Github issue #1949)
Packit 562c7a
Packit 562c7a
* C++ declarations for ``unordered_map`` were corrected.
Packit 562c7a
  Patch by Michael Schatzow.  (Github issue #1484)
Packit 562c7a
Packit 562c7a
* Iterator declarations in C++ ``deque`` and ``vector`` were corrected.
Packit 562c7a
  Patch by Alex Huszagh.  (Github issue #1870)
Packit 562c7a
Packit 562c7a
* The const modifiers in the C++ ``string`` declarations were corrected, together
Packit 562c7a
  with the coercion behaviour of string literals into C++ strings.
Packit 562c7a
  (Github issue #2132)
Packit 562c7a
Packit 562c7a
* Some declaration types in ``libc.limits`` were corrected.
Packit 562c7a
  Patch by Jeroen Demeyer.  (Github issue #2016)
Packit 562c7a
Packit 562c7a
* ``@cython.final`` was not accepted on Python classes with an ``@cython.cclass``
Packit 562c7a
  decorator.  (Github issue #2040)
Packit 562c7a
Packit 562c7a
* Cython no longer creates useless and incorrect ``PyInstanceMethod`` wrappers for
Packit 562c7a
  methods in Python 3.  Patch by Jeroen Demeyer.  (Github issue #2105)
Packit 562c7a
Packit 562c7a
* The builtin ``bytearray`` type could not be used as base type of cdef classes.
Packit 562c7a
  (Github issue #2106)
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.27.3 (2017-11-03)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* String forward references to extension types like ``@cython.locals(x="ExtType")``
Packit 562c7a
  failed to find the named type.  (Github issue #1962)
Packit 562c7a
Packit 562c7a
* NumPy slicing generated incorrect results when compiled with Pythran.
Packit 562c7a
  Original patch by Serge Guelton (Github issue #1946).
Packit 562c7a
Packit 562c7a
* Fix "undefined reference" linker error for generators on Windows in Py3.3-3.5.
Packit 562c7a
  (Github issue #1968)
Packit 562c7a
Packit 562c7a
* Adapt to recent C-API change of ``PyThreadState`` in CPython 3.7.
Packit 562c7a
Packit 562c7a
* Fix signature of ``PyWeakref_GetObject()`` API declaration.
Packit 562c7a
  Patch by Jeroen Demeyer (Github issue #1975).
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.27.2 (2017-10-22)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Comprehensions could incorrectly be optimised away when they appeared in boolean
Packit 562c7a
  test contexts.  (Github issue #1920)
Packit 562c7a
Packit 562c7a
* The special methods ``__eq__``, ``__lt__`` etc. in extension types did not type
Packit 562c7a
  their first argument as the type of the class but ``object``.  (Github issue #1935)
Packit 562c7a
Packit 562c7a
* Crash on first lookup of "cline_in_traceback" option during exception handling.
Packit 562c7a
  (Github issue #1907)
Packit 562c7a
Packit 562c7a
* Some nested module level comprehensions failed to compile.
Packit 562c7a
  (Github issue #1906)
Packit 562c7a
Packit 562c7a
* Compiler crash on some complex type declarations in pure mode.
Packit 562c7a
  (Github issue #1908)
Packit 562c7a
Packit 562c7a
* ``std::unordered_map.erase()`` was declared with an incorrect ``void`` return
Packit 562c7a
  type in ``libcpp.unordered_map``.  (Github issue #1484)
Packit 562c7a
Packit 562c7a
* Invalid use of C++ ``fallthrough`` attribute before C++11 and similar issue in clang.
Packit 562c7a
  (Github issue #1930)
Packit 562c7a
Packit 562c7a
* Compiler crash on misnamed properties. (Github issue #1905)
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.27.1 (2017-10-01)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* The Jupyter magic has a new debug option ``--verbose`` that shows details about
Packit 562c7a
  the distutils invocation.  Patch by Boris Filippov (Github issue #1881).
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Py3 list comprehensions in class bodies resulted in invalid C code.
Packit 562c7a
  (Github issue #1889)
Packit 562c7a
Packit 562c7a
* Modules built for later CPython 3.5.x versions failed to import in 3.5.0/3.5.1.
Packit 562c7a
  (Github issue #1880)
Packit 562c7a
Packit 562c7a
* Deallocating fused types functions and methods kept their GC tracking enabled,
Packit 562c7a
  which could potentially lead to recursive deallocation attempts.
Packit 562c7a
Packit 562c7a
* Crash when compiling in C++ mode with old setuptools versions.
Packit 562c7a
  (Github issue #1879)
Packit 562c7a
Packit 562c7a
* C++ object arguments for the constructor of Cython implemented C++ are now
Packit 562c7a
  passed by reference and not by value to allow for non-copyable arguments, such
Packit 562c7a
  as ``unique_ptr``.
Packit 562c7a
Packit 562c7a
* API-exported C++ classes with Python object members failed to compile.
Packit 562c7a
  (Github issue #1866)
Packit 562c7a
Packit 562c7a
* Some issues with the new relaxed exception value handling were resolved.
Packit 562c7a
Packit 562c7a
* Python classes as annotation types could prevent compilation.
Packit 562c7a
  (Github issue #1887)
Packit 562c7a
Packit 562c7a
* Cython annotation types in Python files could lead to import failures
Packit 562c7a
  with a "cython undefined" error.  Recognised types are now turned into strings.
Packit 562c7a
Packit 562c7a
* Coverage analysis could fail to report on extension modules on some platforms.
Packit 562c7a
Packit 562c7a
* Annotations could be parsed (and rejected) as types even with
Packit 562c7a
  ``annotation_typing=False``.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* PEP 489 support has been disabled by default to counter incompatibilities with
Packit 562c7a
  import setups that try to reload or reinitialise modules.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.27 (2017-09-23)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Extension module initialisation follows
Packit 562c7a
  `PEP 489 <https://www.python.org/dev/peps/pep-0489/>`_ in CPython 3.5+, which
Packit 562c7a
  resolves several differences with regard to normal Python modules.  This makes
Packit 562c7a
  the global names ``__file__`` and ``__path__`` correctly available to module
Packit 562c7a
  level code and improves the support for module-level relative imports.
Packit 562c7a
  (Github issues #1715, #1753, #1035)
Packit 562c7a
Packit 562c7a
* Asynchronous generators (`PEP 525 <https://www.python.org/dev/peps/pep-0525/>`_)
Packit 562c7a
  and asynchronous comprehensions (`PEP 530 <https://www.python.org/dev/peps/pep-0530/>`_)
Packit 562c7a
  have been implemented.  Note that async generators require finalisation support
Packit 562c7a
  in order to allow for asynchronous operations during cleanup, which is only
Packit 562c7a
  available in CPython 3.6+.  All other functionality has been backported as usual.
Packit 562c7a
Packit 562c7a
* Variable annotations are now parsed according to
Packit 562c7a
  `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_.  Cython types (e.g.
Packit 562c7a
  ``cython.int``) are evaluated as C type declarations and everything else as Python
Packit 562c7a
  types.  This can be disabled with the directive ``annotation_typing=False``.
Packit 562c7a
  Note that most complex PEP-484 style annotations are currently ignored.  This will
Packit 562c7a
  change in future releases. (Github issue #1850)
Packit 562c7a
Packit 562c7a
* Extension types (also in pure Python mode) can implement the normal special methods
Packit 562c7a
  ``__eq__``, ``__lt__`` etc. for comparisons instead of the low-level ``__richcmp__``
Packit 562c7a
  method.  (Github issue #690)
Packit 562c7a
Packit 562c7a
* New decorator ``@cython.exceptval(x=None, check=False)`` that makes the signature
Packit 562c7a
  declarations ``except x``, ``except? x`` and ``except *`` available to pure Python
Packit 562c7a
  code.  Original patch by Antonio Cuni.  (Github issue #1653)
Packit 562c7a
Packit 562c7a
* Signature annotations are now included in the signature docstring generated by
Packit 562c7a
  the ``embedsignature`` directive.  Patch by Lisandro Dalcin (Github issue #1781).
Packit 562c7a
Packit 562c7a
* The gdb support for Python code (``libpython.py``) was updated to the latest
Packit 562c7a
  version in CPython 3.7 (git rev 5fe59f8).
Packit 562c7a
Packit 562c7a
* The compiler tries to find a usable exception return value for cdef functions
Packit 562c7a
  with ``except *`` if the returned type allows it.  Note that this feature is subject
Packit 562c7a
  to safety limitations, so it is still better to provide an explicit declaration.
Packit 562c7a
Packit 562c7a
* C functions can be assigned to function pointers with a compatible exception
Packit 562c7a
  declaration, not only with exact matches.  A side-effect is that certain compatible
Packit 562c7a
  signature overrides are now allowed and some more mismatches of exception signatures
Packit 562c7a
  are now detected and rejected as errors that were not detected before.
Packit 562c7a
Packit 562c7a
* The IPython/Jupyter magic integration has a new option ``%%cython --pgo`` for profile
Packit 562c7a
  guided optimisation. It compiles the cell with PGO settings for the C compiler,
Packit 562c7a
  executes it to generate a runtime profile, and then compiles it again using that
Packit 562c7a
  profile for C compiler optimisation.  Currently only tested with gcc.
Packit 562c7a
Packit 562c7a
* ``len(memoryview)`` can be used in nogil sections to get the size of the
Packit 562c7a
  first dimension of a memory view (``shape[0]``). (Github issue #1733)
Packit 562c7a
Packit 562c7a
* C++ classes can now contain (properly refcounted) Python objects.
Packit 562c7a
Packit 562c7a
* NumPy dtype subarrays are now accessible through the C-API.
Packit 562c7a
  Patch by Gerald Dalley (Github issue #245).
Packit 562c7a
Packit 562c7a
* Resolves several issues with PyPy and uses faster async slots in PyPy3.
Packit 562c7a
  Patch by Ronan Lamy (Github issues #1871, #1878).
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Extension types that were cimported from other Cython modules could disagree
Packit 562c7a
  about the order of fused cdef methods in their call table.  This could lead
Packit 562c7a
  to wrong methods being called and potentially also crashes.  The fix required
Packit 562c7a
  changes to the ordering of fused methods in the call table, which may break
Packit 562c7a
  existing compiled modules that call fused cdef methods across module boundaries,
Packit 562c7a
  if these methods were implemented in a different order than they were declared
Packit 562c7a
  in the corresponding .pxd file. (Github issue #1873)
Packit 562c7a
Packit 562c7a
* The exception state handling in generators and coroutines could lead to
Packit 562c7a
  exceptions in the caller being lost if an exception was raised and handled
Packit 562c7a
  inside of the coroutine when yielding. (Github issue #1731)
Packit 562c7a
Packit 562c7a
* Loops over ``range(enum)`` were not converted into C for-loops.  Note that it
Packit 562c7a
  is still recommended to use an explicit cast to a C integer type in this case.
Packit 562c7a
Packit 562c7a
* Error positions of names (e.g. variables) were incorrectly reported after the
Packit 562c7a
  name and not at the beginning of the name.
Packit 562c7a
Packit 562c7a
* Compile time ``DEF`` assignments were evaluated even when they occur inside of
Packit 562c7a
  falsy ``IF`` blocks. (Github issue #1796)
Packit 562c7a
Packit 562c7a
* Disabling the line tracing from a trace function could fail.
Packit 562c7a
  Original patch by Dmitry Trofimov. (Github issue #1769)
Packit 562c7a
Packit 562c7a
* Several issues with the Pythran integration were resolved.
Packit 562c7a
Packit 562c7a
* abs(signed int) now returns a signed rather than unsigned int.
Packit 562c7a
  (Github issue #1837)
Packit 562c7a
Packit 562c7a
* Reading ``frame.f_locals`` of a Cython function (e.g. from a debugger or profiler
Packit 562c7a
  could modify the module globals. (Github issue #1836)
Packit 562c7a
Packit 562c7a
* Buffer type mismatches in the NumPy buffer support could leak a reference to the
Packit 562c7a
  buffer owner.
Packit 562c7a
Packit 562c7a
* Using the "is_f_contig" and "is_c_contig" memoryview methods together could leave
Packit 562c7a
  one of them undeclared. (Github issue #1872)
Packit 562c7a
Packit 562c7a
* Compilation failed if the for-in-range loop target was not a variable but a more
Packit 562c7a
  complex expression, e.g. an item assignment. (Github issue #1831)
Packit 562c7a
Packit 562c7a
* Compile time evaluations of (partially) constant f-strings could show incorrect
Packit 562c7a
  results.
Packit 562c7a
Packit 562c7a
* Escape sequences in raw f-strings (``fr'...'``) were resolved instead of passing
Packit 562c7a
  them through as expected.
Packit 562c7a
Packit 562c7a
* Some ref-counting issues in buffer error handling have been resolved.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Type declarations in signature annotations are now parsed according to
Packit 562c7a
  `PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_
Packit 562c7a
  typing.  Only Cython types (e.g. ``cython.int``) and Python builtin types are
Packit 562c7a
  currently considered as type declarations.  Everything else is ignored, but this
Packit 562c7a
  will change in a future Cython release.
Packit 562c7a
  (Github issue #1672)
Packit 562c7a
Packit 562c7a
* The directive ``annotation_typing`` is now ``True`` by default, which enables
Packit 562c7a
  parsing type declarations from annotations.
Packit 562c7a
Packit 562c7a
* This release no longer supports Python 3.2.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.26.1 (2017-08-29)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* ``cython.view.array`` was missing ``.__len__()``.
Packit 562c7a
Packit 562c7a
* Extension types with a ``.pxd`` override for their ``__releasebuffer__`` slot
Packit 562c7a
  (e.g. as provided by Cython for the Python ``array.array`` type) could leak
Packit 562c7a
  a reference to the buffer owner on release, thus not freeing the memory.
Packit 562c7a
  (Github issue #1638)
Packit 562c7a
Packit 562c7a
* Auto-decoding failed in 0.26 for strings inside of C++ containers.
Packit 562c7a
  (Github issue #1790)
Packit 562c7a
Packit 562c7a
* Compile error when inheriting from C++ container types.
Packit 562c7a
  (Github issue #1788)
Packit 562c7a
Packit 562c7a
* Invalid C code in generators (declaration after code).
Packit 562c7a
  (Github issue #1801)
Packit 562c7a
Packit 562c7a
* Arithmetic operations on ``const`` integer variables could generate invalid code.
Packit 562c7a
  (Github issue #1798)
Packit 562c7a
Packit 562c7a
* Local variables with names of special Python methods failed to compile inside of
Packit 562c7a
  closures. (Github issue #1797)
Packit 562c7a
Packit 562c7a
* Problem with indirect Emacs buffers in cython-mode.
Packit 562c7a
  Patch by Martin Albrecht (Github issue #1743).
Packit 562c7a
Packit 562c7a
* Extension types named ``result`` or ``PickleError`` generated invalid unpickling code.
Packit 562c7a
  Patch by Jason Madden (Github issue #1786).
Packit 562c7a
Packit 562c7a
* Bazel integration failed to compile ``.py`` files.
Packit 562c7a
  Patch by Guro Bokum (Github issue #1784).
Packit 562c7a
Packit 562c7a
* Some include directories and dependencies were referenced with their absolute paths
Packit 562c7a
  in the generated files despite lying within the project directory.
Packit 562c7a
Packit 562c7a
* Failure to compile in Py3.7 due to a modified signature of ``_PyCFunctionFast()``
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.26 (2017-07-19)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Pythran can be used as a backend for evaluating NumPy array expressions.
Packit 562c7a
  Patch by Adrien Guinet (Github issue #1607).
Packit 562c7a
Packit 562c7a
* cdef classes now support pickling by default when possible.
Packit 562c7a
  This can be disabled with the ``auto_pickle`` directive.
Packit 562c7a
Packit 562c7a
* Speed up comparisons of strings if their hash value is available.
Packit 562c7a
  Patch by Claudio Freire (Github issue #1571).
Packit 562c7a
Packit 562c7a
* Support pyximport from zip files.
Packit 562c7a
  Patch by Sergei Lebedev (Github issue #1485).
Packit 562c7a
Packit 562c7a
* IPython magic now respects the ``__all__`` variable and ignores
Packit 562c7a
  names with leading-underscore (like ``import *`` does).
Packit 562c7a
  Patch by Syrtis Major (Github issue #1625).
Packit 562c7a
Packit 562c7a
* ``abs()`` is optimised for C complex numbers.
Packit 562c7a
  Patch by da-woods (Github issue #1648).
Packit 562c7a
Packit 562c7a
* The display of C lines in Cython tracebacks can now be enabled at runtime
Packit 562c7a
  via ``import cython_runtime; cython_runtime.cline_in_traceback=True``.
Packit 562c7a
  The default has been changed to False.
Packit 562c7a
Packit 562c7a
* The overhead of calling fused types generic functions was reduced.
Packit 562c7a
Packit 562c7a
* "cdef extern" include files are now also searched relative to the current file.
Packit 562c7a
  Patch by Jeroen Demeyer (Github issue #1654).
Packit 562c7a
Packit 562c7a
* Optional optimization for re-aquiring the GIL, controlled by the
Packit 562c7a
  `fast_gil` directive.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Item lookup/assignment with a unicode character as index that is typed
Packit 562c7a
  (explicitly or implicitly) as ``Py_UCS4`` or ``Py_UNICODE`` used the
Packit 562c7a
  integer value instead of the Unicode string value. Code that relied on
Packit 562c7a
  the previous behaviour now triggers a warning that can be disabled by
Packit 562c7a
  applying an explicit cast. (Github issue #1602)
Packit 562c7a
Packit 562c7a
* f-string processing was adapted to changes in PEP 498 and CPython 3.6.
Packit 562c7a
Packit 562c7a
* Invalid C code when decoding from UTF-16(LE/BE) byte strings.
Packit 562c7a
  (Github issue #1696)
Packit 562c7a
Packit 562c7a
* Unicode escapes in 'ur' raw-unicode strings were not resolved in Py2 code.
Packit 562c7a
  Original patch by Aaron Gallagher (Github issue #1594).
Packit 562c7a
Packit 562c7a
* File paths of code objects are now relative.
Packit 562c7a
  Original patch by Jelmer Vernooij (Github issue #1565).
Packit 562c7a
Packit 562c7a
* Decorators of cdef class methods could be executed twice.
Packit 562c7a
  Patch by Jeroen Demeyer (Github issue #1724).
Packit 562c7a
Packit 562c7a
* Dict iteration using the Py2 ``iter*`` methods failed in PyPy3.
Packit 562c7a
  Patch by Armin Rigo (Github issue #1631).
Packit 562c7a
Packit 562c7a
* Several warnings in the generated code are now suppressed.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The ``unraisable_tracebacks`` option now defaults to ``True``.
Packit 562c7a
Packit 562c7a
* Coercion of C++ containers to Python is no longer automatic on attribute
Packit 562c7a
  access (Github issue #1521).
Packit 562c7a
Packit 562c7a
* Access to Python attributes of cimported modules without the corresponding
Packit 562c7a
  import is now a compile-time (rather than runtime) error.
Packit 562c7a
Packit 562c7a
* Do not use special dll linkage for "cdef public" functions.
Packit 562c7a
  Patch by Jeroen Demeyer (Github issue #1687).
Packit 562c7a
Packit 562c7a
* cdef/cpdef methods must match their declarations.  See Github Issue #1732.
Packit 562c7a
  This is now a warning and will be an error in future releases.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.25.2 (2016-12-08)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Fixes several issues with C++ template deduction.
Packit 562c7a
Packit 562c7a
* Fixes a issue with bound method type inference (Github issue #551).
Packit 562c7a
Packit 562c7a
* Fixes a bug with cascaded tuple assignment (Github issue #1523).
Packit 562c7a
Packit 562c7a
* Fixed or silenced many Clang warnings.
Packit 562c7a
Packit 562c7a
* Fixes bug with powers of pure real complex numbers (Github issue #1538).
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.25.1 (2016-10-26)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Fixes a bug with ``isinstance(o, Exception)`` (Github issue #1496).
Packit 562c7a
Packit 562c7a
* Fixes bug with ``cython.view.array`` missing utility code in some cases
Packit 562c7a
  (Github issue #1502).
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The distutils extension ``Cython.Distutils.build_ext`` has been reverted,
Packit 562c7a
  temporarily, to be ``old_build_ext`` to give projects time to migrate.
Packit 562c7a
  The new build_ext is available as ``new_build_ext``.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.25 (2016-10-25)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* def/cpdef methods of cdef classes benefit from Cython's internal function
Packit 562c7a
  implementation, which enables introspection and line profiling for them.
Packit 562c7a
  Implementation sponsored by Turbostream (www.turbostream-cfd.com).
Packit 562c7a
Packit 562c7a
* Calls to Python functions are faster, following the recent "FastCall"
Packit 562c7a
  optimisations that Victor Stinner implemented for CPython 3.6.
Packit 562c7a
  See https://bugs.python.org/issue27128 and related issues.
Packit 562c7a
Packit 562c7a
* The new METH_FASTCALL calling convention for PyCFunctions is supported
Packit 562c7a
  in CPython 3.6.  See https://bugs.python.org/issue27810
Packit 562c7a
Packit 562c7a
* Initial support for using Cython modules in Pyston.
Packit 562c7a
  Patch by Boxiang Sun.
Packit 562c7a
Packit 562c7a
* Dynamic Python attributes are allowed on cdef classes if an attribute
Packit 562c7a
  ``cdef dict __dict__`` is declared in the class.  Patch by empyrical.
Packit 562c7a
Packit 562c7a
* Cython implemented C++ classes can make direct calls to base class methods.
Packit 562c7a
  Patch by empyrical.
Packit 562c7a
Packit 562c7a
* C++ classes can now have typedef members. STL containers updated with
Packit 562c7a
  value_type.
Packit 562c7a
Packit 562c7a
* New directive ``cython.no_gc`` to fully disable GC for a cdef class.
Packit 562c7a
  Patch by Claudio Freire.
Packit 562c7a
Packit 562c7a
* Buffer variables are no longer excluded from ``locals()``.
Packit 562c7a
  Patch by da-woods.
Packit 562c7a
Packit 562c7a
* Building f-strings is faster, especially when formatting C integers.
Packit 562c7a
Packit 562c7a
* for-loop iteration over "std::string".
Packit 562c7a
Packit 562c7a
* ``libc/math.pxd`` provides ``e`` and ``pi`` as alias constants to simplify
Packit 562c7a
  usage as a drop-in replacement for Python's math module.
Packit 562c7a
Packit 562c7a
* Speed up cython.inline().
Packit 562c7a
Packit 562c7a
* Binary lshift operations with small constant Python integers are faster.
Packit 562c7a
Packit 562c7a
* Some integer operations on Python long objects are faster in Python 2.7.
Packit 562c7a
Packit 562c7a
* Support for the C++ ``typeid`` operator.
Packit 562c7a
Packit 562c7a
* Support for bazel using a the pyx_library rule in //Tools:rules.bzl.
Packit 562c7a
Packit 562c7a
Significant Bugs fixed
Packit 562c7a
----------------------
Packit 562c7a
Packit 562c7a
* Division of complex numbers avoids overflow by using Smith's method.
Packit 562c7a
Packit 562c7a
* Some function signatures in ``libc.math`` and ``numpy.pxd`` were incorrect.
Packit 562c7a
  Patch by Michael Seifert.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The "%%cython" IPython/jupyter magic now defaults to the language level of
Packit 562c7a
  the current jupyter kernel.  The language level can be set explicitly with
Packit 562c7a
  "%%cython -2" or "%%cython -3".
Packit 562c7a
Packit 562c7a
* The distutils extension ``Cython.Distutils.build_ext`` has now been updated
Packit 562c7a
  to use cythonize which properly handles dependencies.  The old extension can
Packit 562c7a
  still be found in ``Cython.Distutils.old_build_ext`` and is now deprecated.
Packit 562c7a
Packit 562c7a
* ``directive_defaults`` is no longer available in ``Cython.Compiler.Options``,
Packit 562c7a
  use ``get_directive_defaults()`` instead.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.24.1 (2016-07-15)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* IPython cell magic was lacking a good way to enable Python 3 code semantics.
Packit 562c7a
  It can now be used as "%%cython -3".
Packit 562c7a
Packit 562c7a
* Follow a recent change in `PEP 492 <https://www.python.org/dev/peps/pep-0492/>`_
Packit 562c7a
  and CPython 3.5.2 that now requires the ``__aiter__()`` method of asynchronous
Packit 562c7a
  iterators to be a simple ``def`` method instead of an ``async def`` method.
Packit 562c7a
Packit 562c7a
* Coroutines and generators were lacking the ``__module__`` special attribute.
Packit 562c7a
Packit 562c7a
* C++ ``std::complex`` values failed to auto-convert from and to Python complex
Packit 562c7a
  objects.
Packit 562c7a
Packit 562c7a
* Namespaced C++ types could not be used as memory view types due to lack of
Packit 562c7a
  name mangling.  Patch by Ivan Smirnov.
Packit 562c7a
Packit 562c7a
* Assignments between identical C++ types that were declared with differently
Packit 562c7a
  typedefed template types could fail.
Packit 562c7a
Packit 562c7a
* Rebuilds could fail to evaluate dependency timestamps in C++ mode.
Packit 562c7a
  Patch by Ian Henriksen.
Packit 562c7a
Packit 562c7a
* Macros defined in the ``distutils`` compiler option do not require values
Packit 562c7a
  anymore.  Patch by Ian Henriksen.
Packit 562c7a
Packit 562c7a
* Minor fixes for MSVC, Cygwin and PyPy.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.24 (2016-04-04)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* `PEP 498 <https://www.python.org/dev/peps/pep-0498/>`_:
Packit 562c7a
  Literal String Formatting (f-strings).
Packit 562c7a
  Original patch by Jelle Zijlstra.
Packit 562c7a
Packit 562c7a
* `PEP 515 <https://www.python.org/dev/peps/pep-0515/>`_:
Packit 562c7a
  Underscores as visual separators in number literals.
Packit 562c7a
Packit 562c7a
* Parser was adapted to some minor syntax changes in Py3.6, e.g.
Packit 562c7a
  https://bugs.python.org/issue9232
Packit 562c7a
Packit 562c7a
* The embedded C code comments that show the original source code
Packit 562c7a
  can be discarded with the new directive ``emit_code_comments=False``.
Packit 562c7a
Packit 562c7a
* Cpdef enums are now first-class iterable, callable types in Python.
Packit 562c7a
Packit 562c7a
* Ctuples can now be declared in pure Python code.
Packit 562c7a
Packit 562c7a
* Posix declarations for DLL loading and stdio extensions were added.
Packit 562c7a
  Patch by Lars Buitinck.
Packit 562c7a
Packit 562c7a
* The Py2-only builtins ``unicode()``, ``xrange()``, ``reduce()`` and
Packit 562c7a
  ``long`` are now also available in compile time ``DEF`` expressions
Packit 562c7a
  when compiling with Py3.
Packit 562c7a
Packit 562c7a
* Exception type tests have slightly lower overhead.
Packit 562c7a
  This fixes ticket 868.
Packit 562c7a
Packit 562c7a
* @property syntax fully supported in cdef classes, old syntax deprecated.
Packit 562c7a
Packit 562c7a
* C++ classes can now be declared with default template parameters.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* C++ exceptions raised by overloaded C++ operators were not always
Packit 562c7a
  handled.  Patch by Ian Henriksen.
Packit 562c7a
Packit 562c7a
* C string literals were previously always stored as non-const global
Packit 562c7a
  variables in the module.  They are now stored as global constants
Packit 562c7a
  when possible, and otherwise as non-const C string literals in the
Packit 562c7a
  generated code that uses them.  This improves compatibility with
Packit 562c7a
  strict C compiler options and prevents non-const strings literals
Packit 562c7a
  with the same content from being incorrectly merged.
Packit 562c7a
Packit 562c7a
* Compile time evaluated ``str`` expressions (``DEF``) now behave in a
Packit 562c7a
  more useful way by turning into Unicode strings when compiling under
Packit 562c7a
  Python 3.  This allows using them as intermediate values in expressions.
Packit 562c7a
  Previously, they always evaluated to bytes objects.
Packit 562c7a
Packit 562c7a
* ``isinf()`` declarations in ``libc/math.pxd`` and ``numpy/math.pxd`` now
Packit 562c7a
  reflect the actual tristate ``int`` return value instead of using ``bint``.
Packit 562c7a
Packit 562c7a
* Literal assignments to ctuples avoid Python tuple round-trips in some
Packit 562c7a
  more corner cases.
Packit 562c7a
Packit 562c7a
* Iteration over ``dict(...).items()`` failed to get optimised when dict
Packit 562c7a
  arguments included keyword arguments.
Packit 562c7a
Packit 562c7a
* cProfile now correctly profiles cpdef functions and methods.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23.5 (2016-03-26)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
* Compile errors and warnings in integer type conversion code.  This fixes
Packit 562c7a
  ticket 877.  Patches by Christian Neukirchen, Nikolaus Rath, Ian Henriksen.
Packit 562c7a
Packit 562c7a
* Reference leak when "*args" argument was reassigned in closures.
Packit 562c7a
Packit 562c7a
* Truth-testing Unicode strings could waste time and memory in Py3.3+.
Packit 562c7a
Packit 562c7a
* Return values of async functions could be ignored and replaced by ``None``.
Packit 562c7a
Packit 562c7a
* Compiler crash in CPython 3.6.
Packit 562c7a
Packit 562c7a
* Fix prange() to behave identically to range().  The end condition was
Packit 562c7a
  miscalculated when the range was not exactly divisible by the step.
Packit 562c7a
Packit 562c7a
* Optimised ``all(genexpr)``/``any(genexpr)`` calls could warn about unused
Packit 562c7a
  code.  This fixes ticket 876.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23.4 (2015-10-10)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Memory leak when calling Python functions in PyPy.
Packit 562c7a
Packit 562c7a
* Compilation problem with MSVC in C99-ish mode.
Packit 562c7a
Packit 562c7a
* Warning about unused values in a helper macro.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23.3 (2015-09-29)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Invalid C code for some builtin methods.  This fixes ticket 856 again.
Packit 562c7a
Packit 562c7a
* Incorrect C code in helper functions for PyLong conversion and string
Packit 562c7a
  decoding.  This fixes ticket 863, ticket 864 and ticket 865.
Packit 562c7a
  Original patch by Nikolaus Rath.
Packit 562c7a
Packit 562c7a
* Large folded or inserted integer constants could use too small C
Packit 562c7a
  integer types and thus trigger a value wrap-around.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The coroutine and generator types of Cython now also register directly
Packit 562c7a
  with the ``Coroutine`` and ``Generator`` ABCs in the ``backports_abc``
Packit 562c7a
  module if it can be imported.  This fixes ticket 870.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23.2 (2015-09-11)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Compiler crash when analysing some optimised expressions.
Packit 562c7a
Packit 562c7a
* Coverage plugin was adapted to coverage.py 4.0 beta 2.
Packit 562c7a
Packit 562c7a
* C++ destructor calls could fail when '&' operator is overwritten.
Packit 562c7a
Packit 562c7a
* Incorrect C literal generation for large integers in compile-time
Packit 562c7a
  evaluated DEF expressions and constant folded expressions.
Packit 562c7a
Packit 562c7a
* Byte string constants could end up as Unicode strings when originating
Packit 562c7a
  from compile-time evaluated DEF expressions.
Packit 562c7a
Packit 562c7a
* Invalid C code when caching known builtin methods.
Packit 562c7a
  This fixes ticket 860.
Packit 562c7a
Packit 562c7a
* ``ino_t`` in ``posix.types`` was not declared as ``unsigned``.
Packit 562c7a
Packit 562c7a
* Declarations in ``libcpp/memory.pxd`` were missing ``operator!()``.
Packit 562c7a
  Patch by Leo Razoumov.
Packit 562c7a
Packit 562c7a
* Static cdef methods can now be declared in .pxd files.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23.1 (2015-08-22)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Invalid C code for generators.  This fixes ticket 858.
Packit 562c7a
Packit 562c7a
* Invalid C code for some builtin methods.  This fixes ticket 856.
Packit 562c7a
Packit 562c7a
* Invalid C code for unused local buffer variables.
Packit 562c7a
  This fixes ticket 154.
Packit 562c7a
Packit 562c7a
* Test failures on 32bit systems.  This fixes ticket 857.
Packit 562c7a
Packit 562c7a
* Code that uses ``from xyz import *`` and global C struct/union/array
Packit 562c7a
  variables could fail to compile due to missing helper functions.
Packit 562c7a
  This fixes ticket 851.
Packit 562c7a
Packit 562c7a
* Misnamed PEP 492 coroutine property ``cr_yieldfrom`` renamed to
Packit 562c7a
  ``cr_await`` to match CPython.
Packit 562c7a
Packit 562c7a
* Missing deallocation code for C++ object attributes in certain
Packit 562c7a
  extension class hierarchies.
Packit 562c7a
Packit 562c7a
* Crash when async coroutine was not awaited.
Packit 562c7a
Packit 562c7a
* Compiler crash on ``yield`` in signature annotations and default
Packit 562c7a
  argument values.  Both are forbidden now.
Packit 562c7a
Packit 562c7a
* Compiler crash on certain constructs in ``finally`` clauses.
Packit 562c7a
Packit 562c7a
* Cython failed to build when CPython's pgen is installed.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.23 (2015-08-08)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* `PEP 492 <https://www.python.org/dev/peps/pep-0492/>`_
Packit 562c7a
  (async/await) was implemented.
Packit 562c7a
Packit 562c7a
* `PEP 448 <https://www.python.org/dev/peps/pep-0448/>`_
Packit 562c7a
  (Additional Unpacking Generalizations) was implemented.
Packit 562c7a
Packit 562c7a
* Support for coverage.py 4.0+ can be enabled by adding the plugin
Packit 562c7a
  "Cython.Coverage" to the ".coveragerc" config file.
Packit 562c7a
Packit 562c7a
* Annotated HTML source pages can integrate (XML) coverage reports.
Packit 562c7a
Packit 562c7a
* Tracing is supported in ``nogil`` functions/sections and module init code.
Packit 562c7a
Packit 562c7a
* When generators are used in a Cython module and the module imports the
Packit 562c7a
  modules "inspect" and/or "asyncio", Cython enables interoperability by
Packit 562c7a
  patching these modules during the import to recognise Cython's internal
Packit 562c7a
  generator and coroutine types. This can be disabled by C compiling the
Packit 562c7a
  module with "-D CYTHON_PATCH_ASYNCIO=0" or "-D CYTHON_PATCH_INSPECT=0"
Packit 562c7a
Packit 562c7a
* When generators or coroutines are used in a Cython module, their types
Packit 562c7a
  are registered with the ``Generator`` and ``Coroutine`` ABCs in the
Packit 562c7a
  ``collections`` or ``collections.abc`` stdlib module at import time to
Packit 562c7a
  enable interoperability with code that needs to detect and process Python
Packit 562c7a
  generators/coroutines.  These ABCs were added in CPython 3.5 and are
Packit 562c7a
  available for older Python versions through the ``backports_abc`` module
Packit 562c7a
  on PyPI.  See https://bugs.python.org/issue24018
Packit 562c7a
Packit 562c7a
* Adding/subtracting/dividing/modulus and equality comparisons with
Packit 562c7a
  constant Python floats and small integers are faster.
Packit 562c7a
Packit 562c7a
* Binary and/or/xor/rshift operations with small constant Python integers
Packit 562c7a
  are faster.
Packit 562c7a
Packit 562c7a
* When called on generator expressions, the builtins ``all()``, ``any()``,
Packit 562c7a
  ``dict()``, ``list()``, ``set()``, ``sorted()`` and ``unicode.join()``
Packit 562c7a
  avoid the generator iteration overhead by inlining a part of their
Packit 562c7a
  functionality into the for-loop.
Packit 562c7a
Packit 562c7a
* Keyword argument dicts are no longer copied on function entry when they
Packit 562c7a
  are not being used or only passed through to other function calls (e.g.
Packit 562c7a
  in wrapper functions).
Packit 562c7a
Packit 562c7a
* The ``PyTypeObject`` declaration in ``cpython.object`` was extended.
Packit 562c7a
Packit 562c7a
* The builtin ``type`` type is now declared as PyTypeObject in source,
Packit 562c7a
  allowing for extern functions taking type parameters to have the correct
Packit 562c7a
  C signatures.  Note that this might break code that uses ``type`` just
Packit 562c7a
  for passing around Python types in typed variables.  Removing the type
Packit 562c7a
  declaration provides a backwards compatible fix.
Packit 562c7a
Packit 562c7a
* ``wraparound()`` and ``boundscheck()`` are available as no-ops in pure
Packit 562c7a
  Python mode.
Packit 562c7a
Packit 562c7a
* Const iterators were added to the provided C++ STL declarations.
Packit 562c7a
Packit 562c7a
* Smart pointers were added to the provided C++ STL declarations.
Packit 562c7a
  Patch by Daniel Filonik.
Packit 562c7a
Packit 562c7a
* ``NULL`` is allowed as default argument when embedding signatures.
Packit 562c7a
  This fixes ticket 843.
Packit 562c7a
Packit 562c7a
* When compiling with ``--embed``, the internal module name is changed to
Packit 562c7a
  ``__main__`` to allow arbitrary program names, including those that would
Packit 562c7a
  be invalid for modules.  Note that this prevents reuse of the generated
Packit 562c7a
  C code as an importable module.
Packit 562c7a
Packit 562c7a
* External C++ classes that overload the assignment operator can be used.
Packit 562c7a
  Patch by Ian Henriksen.
Packit 562c7a
Packit 562c7a
* Support operator bool() for C++ classes so they can be used in if statements.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Calling "yield from" from Python on a Cython generator that returned a
Packit 562c7a
  value triggered a crash in CPython.  This is now being worked around.
Packit 562c7a
  See https://bugs.python.org/issue23996
Packit 562c7a
Packit 562c7a
* Language level 3 did not enable true division (a.k.a. float division)
Packit 562c7a
  for integer operands.
Packit 562c7a
Packit 562c7a
* Functions with fused argument types that included a generic 'object'
Packit 562c7a
  fallback could end up using that fallback also for other explicitly
Packit 562c7a
  listed object types.
Packit 562c7a
Packit 562c7a
* Relative cimports could accidentally fall back to trying an absolute
Packit 562c7a
  cimport on failure.
Packit 562c7a
Packit 562c7a
* The result of calling a C struct constructor no longer requires an
Packit 562c7a
  intermediate assignment when coercing to a Python dict.
Packit 562c7a
Packit 562c7a
* C++ exception declarations with mapping functions could fail to compile
Packit 562c7a
  when pre-declared in .pxd files.
Packit 562c7a
Packit 562c7a
* ``cpdef void`` methods are now permitted.
Packit 562c7a
Packit 562c7a
* ``abs(cint)`` could fail to compile in MSVC and used sub-optimal code
Packit 562c7a
  in C++.  Patch by David Vierra, original patch by Michael Enßlin.
Packit 562c7a
Packit 562c7a
* Buffer index calculations using index variables with small C integer
Packit 562c7a
  types could overflow for large buffer sizes.
Packit 562c7a
  Original patch by David Vierra.
Packit 562c7a
Packit 562c7a
* C unions use a saner way to coerce from and to Python dicts.
Packit 562c7a
Packit 562c7a
* When compiling a module ``foo.pyx``, the directories in ``sys.path``
Packit 562c7a
  are no longer searched when looking for ``foo.pxd``.
Packit 562c7a
  Patch by Jeroen Demeyer.
Packit 562c7a
Packit 562c7a
* Memory leaks in the embedding main function were fixed.
Packit 562c7a
  Original patch by Michael Enßlin.
Packit 562c7a
Packit 562c7a
* Some complex Python expressions could fail to compile inside of finally
Packit 562c7a
  clauses.
Packit 562c7a
Packit 562c7a
* Unprefixed 'str' literals were not supported as C varargs arguments.
Packit 562c7a
Packit 562c7a
* Fixed type errors in conversion enum types to/from Python.  Note that
Packit 562c7a
  this imposes stricter correctness requirements on enum declarations.
Packit 562c7a
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Changed mangling scheme in header files generated by ``cdef api``
Packit 562c7a
  declarations.
Packit 562c7a
Packit 562c7a
* Installation under CPython 3.3+ no longer requires a pass of the
Packit 562c7a
  2to3 tool.  This also makes it possible to run Cython in Python
Packit 562c7a
  3.3+ from a source checkout without installing it first.
Packit 562c7a
  Patch by Petr Viktorin.
Packit 562c7a
Packit 562c7a
* ``jedi-typer.py`` (in ``Tools/``) was extended and renamed to
Packit 562c7a
  ``jedityper.py`` (to make it importable) and now works with and
Packit 562c7a
  requires Jedi 0.9.  Patch by Tzer-jen Wei.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.22.1 (2015-06-20)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Crash when returning values on generator termination.
Packit 562c7a
Packit 562c7a
* In some cases, exceptions raised during internal isinstance() checks were
Packit 562c7a
  not propagated.
Packit 562c7a
Packit 562c7a
* Runtime reported file paths of source files (e.g for profiling and tracing)
Packit 562c7a
  are now relative to the build root directory instead of the main source file.
Packit 562c7a
Packit 562c7a
* Tracing exception handling code could enter the trace function with an active
Packit 562c7a
  exception set.
Packit 562c7a
Packit 562c7a
* The internal generator function type was not shared across modules.
Packit 562c7a
Packit 562c7a
* Comparisons of (inferred) ctuples failed to compile.
Packit 562c7a
Packit 562c7a
* Closures inside of cdef functions returning ``void`` failed to compile.
Packit 562c7a
Packit 562c7a
* Using ``const`` C++ references in intermediate parts of longer expressions
Packit 562c7a
  could fail to compile.
Packit 562c7a
Packit 562c7a
* C++ exception declarations with mapping functions could fail to compile when
Packit 562c7a
  pre-declared in .pxd files.
Packit 562c7a
Packit 562c7a
* C++ compilation could fail with an ambiguity error in recent MacOS-X Xcode
Packit 562c7a
  versions.
Packit 562c7a
Packit 562c7a
* C compilation could fail in pypy3.
Packit 562c7a
Packit 562c7a
* Fixed a memory leak in the compiler when compiling multiple modules.
Packit 562c7a
Packit 562c7a
* When compiling multiple modules, external library dependencies could leak
Packit 562c7a
  into later compiler runs.  Fix by Jeroen Demeyer.  This fixes ticket 845.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.22 (2015-02-11)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* C functions can coerce to Python functions, which allows passing them
Packit 562c7a
  around as callable objects.
Packit 562c7a
Packit 562c7a
* C arrays can be assigned by value and auto-coerce from Python iterables
Packit 562c7a
  and to Python lists (and tuples).
Packit 562c7a
Packit 562c7a
* Extern C functions can now be declared as cpdef to export them to
Packit 562c7a
  the module's Python namespace.  Extern C functions in pxd files export
Packit 562c7a
  their values to their own module, iff it exists.
Packit 562c7a
Packit 562c7a
* Anonymous C tuple types can be declared as (ctype1, ctype2, ...).
Packit 562c7a
Packit 562c7a
* `PEP 479 <https://www.python.org/dev/peps/pep-0479/>`_:
Packit 562c7a
  turn accidental StopIteration exceptions that exit generators
Packit 562c7a
  into a RuntimeError, activated with future import "generator_stop".
Packit 562c7a
Packit 562c7a
* Looping over ``reversed(range())`` is optimised in the same way as
Packit 562c7a
  ``range()``.  Patch by Favian Contreras.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Mismatching 'except' declarations on signatures in .pxd and .pyx files failed
Packit 562c7a
  to produce a compile error.
Packit 562c7a
Packit 562c7a
* Failure to find any files for the path pattern(s) passed into ``cythonize()``
Packit 562c7a
  is now an error to more easily detect accidental typos.
Packit 562c7a
Packit 562c7a
* The ``logaddexp`` family of functions in ``numpy.math`` now has correct
Packit 562c7a
  declarations.
Packit 562c7a
Packit 562c7a
* In Py2.6/7 and Py3.2, simple Cython memory views could accidentally be
Packit 562c7a
  interpreted as non-contiguous by CPython, which could trigger a CPython
Packit 562c7a
  bug when copying data from them, thus leading to data corruption.
Packit 562c7a
  See CPython issues 12834 and 23349.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Preliminary support for defining the Cython language with a formal grammar.
Packit 562c7a
  To try parsing your files against this grammar, use the --formal_grammar directive.
Packit 562c7a
  Experimental.
Packit 562c7a
Packit 562c7a
* ``_`` is no longer considered a cacheable builtin as it could interfere with
Packit 562c7a
  gettext.
Packit 562c7a
Packit 562c7a
* Cythonize-computed metadata now cached in the generated C files.
Packit 562c7a
Packit 562c7a
* Several corrections and extensions in numpy, cpython, and libcpp pxd files.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.21.2 (2014-12-27)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Crash when assigning a C value to both a Python and C target at the same time.
Packit 562c7a
Packit 562c7a
* Automatic coercion from C++ strings to ``str`` generated incomplete code that
Packit 562c7a
  failed to compile.
Packit 562c7a
Packit 562c7a
* Declaring a constructor in a C++ child class erroneously required a default
Packit 562c7a
  constructor declaration in the super class.
Packit 562c7a
Packit 562c7a
* ``resize_smart()`` in ``cpython.array`` was broken.
Packit 562c7a
Packit 562c7a
* Functions in ``libcpp.cast`` are now declared as ``nogil``.
Packit 562c7a
Packit 562c7a
* Some missing C-API declarations were added.
Packit 562c7a
Packit 562c7a
* Py3 main code in embedding program code was lacking casts.
Packit 562c7a
Packit 562c7a
* Exception related to distutils "Distribution" class type in pyximport under
Packit 562c7a
  latest CPython 2.7 and 3.4 releases when setuptools is being imported later.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.21.1 (2014-10-18)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* New ``cythonize`` option ``-a`` to generate the annotated HTML source view.
Packit 562c7a
Packit 562c7a
* Missing C-API declarations in ``cpython.unicode`` were added.
Packit 562c7a
Packit 562c7a
* Passing ``language='c++'`` into cythonize() globally enables C++ mode for
Packit 562c7a
  all modules that were not passed as Extension objects (i.e. only source
Packit 562c7a
  files and file patterns).
Packit 562c7a
Packit 562c7a
* ``Py_hash_t`` is a known type (used in CPython for hash values).
Packit 562c7a
Packit 562c7a
* ``PySlice_*()`` C-API functions are available from the ``cpython.slice``
Packit 562c7a
  module.
Packit 562c7a
Packit 562c7a
* Allow arrays of C++ classes.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Reference leak for non-simple Python expressions in boolean and/or expressions.
Packit 562c7a
Packit 562c7a
* To fix a name collision and to reflect availability on host platforms,
Packit 562c7a
  standard C declarations [ clock(), time(), struct tm and tm* functions ]
Packit 562c7a
  were moved from posix/time.pxd to a new libc/time.pxd.  Patch by Charles
Packit 562c7a
  Blake.
Packit 562c7a
Packit 562c7a
* Rerunning unmodified modules in IPython's cython support failed.
Packit 562c7a
  Patch by Matthias Bussonier.
Packit 562c7a
Packit 562c7a
* Casting C++ ``std::string`` to Python byte strings failed when
Packit 562c7a
  auto-decoding was enabled.
Packit 562c7a
Packit 562c7a
* Fatal exceptions in global module init code could lead to crashes
Packit 562c7a
  if the already created module was used later on (e.g. through a
Packit 562c7a
  stale reference in sys.modules or elsewhere).
Packit 562c7a
Packit 562c7a
* ``cythonize.py`` script was not installed on MS-Windows.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Compilation no longer fails hard when unknown compilation options are
Packit 562c7a
  passed.  Instead, it raises a warning and ignores them (as it did silently
Packit 562c7a
  before 0.21).  This will be changed back to an error in a future release.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.21 (2014-09-10)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* C (cdef) functions allow inner Python functions.
Packit 562c7a
Packit 562c7a
* Enums can now be declared as cpdef to export their values to
Packit 562c7a
  the module's Python namespace.  Cpdef enums in pxd files export
Packit 562c7a
  their values to their own module, iff it exists.
Packit 562c7a
Packit 562c7a
* Allow @staticmethod decorator to declare static cdef methods.
Packit 562c7a
  This is especially useful for declaring "constructors" for
Packit 562c7a
  cdef classes that can take non-Python arguments.
Packit 562c7a
Packit 562c7a
* Taking a ``char*`` from a temporary Python string object is safer
Packit 562c7a
  in more cases and can be done inside of non-trivial expressions,
Packit 562c7a
  including arguments of a function call.  A compile time error
Packit 562c7a
  is raised only when such a pointer is assigned to a variable and
Packit 562c7a
  would thus exceed the lifetime of the string itself.
Packit 562c7a
Packit 562c7a
* Generators have new properties ``__name__`` and ``__qualname__``
Packit 562c7a
  that provide the plain/qualified name of the generator function
Packit 562c7a
  (following CPython 3.5).  See http://bugs.python.org/issue21205
Packit 562c7a
Packit 562c7a
* The ``inline`` function modifier is available as a decorator
Packit 562c7a
  ``@cython.inline`` in pure mode.
Packit 562c7a
Packit 562c7a
* When cygdb is run in a virtualenv, it enables the same virtualenv
Packit 562c7a
  inside of the debugger. Patch by Marc Abramowitz.
Packit 562c7a
Packit 562c7a
* PEP 465: dedicated infix operator for matrix multiplication (A @ B).
Packit 562c7a
Packit 562c7a
* HTML output of annotated code uses Pygments for code highlighting
Packit 562c7a
  and generally received a major overhaul by Matthias Bussonier.
Packit 562c7a
Packit 562c7a
* IPython magic support is now available directly from Cython with
Packit 562c7a
  the command "%load_ext cython".  Cython code can directly be
Packit 562c7a
  executed in a cell when marked with "%%cython".  Code analysis
Packit 562c7a
  is available with "%%cython -a".  Patch by Martín Gaitán.
Packit 562c7a
Packit 562c7a
* Simple support for declaring Python object types in Python signature
Packit 562c7a
  annotations.  Currently requires setting the compiler directive
Packit 562c7a
  ``annotation_typing=True``.
Packit 562c7a
Packit 562c7a
* New directive ``use_switch`` (defaults to True) to optionally disable
Packit 562c7a
  the optimization of chained if statement to C switch statements.
Packit 562c7a
Packit 562c7a
* Defines dynamic_cast et al. in ``libcpp.cast`` and C++ heap data
Packit 562c7a
  structure operations in ``libcpp.algorithm``.
Packit 562c7a
Packit 562c7a
* Shipped header declarations in ``posix.*`` were extended to cover
Packit 562c7a
  more of the POSIX API.  Patches by Lars Buitinck and Mark Peek.
Packit 562c7a
Packit 562c7a
Optimizations
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Simple calls to C implemented Python functions/methods are faster.
Packit 562c7a
  This also speeds up many operations on builtins that Cython cannot
Packit 562c7a
  otherwise optimise.
Packit 562c7a
Packit 562c7a
* The "and"/"or" operators try to avoid unnecessary coercions of their
Packit 562c7a
  arguments.  They now evaluate the truth value of each argument
Packit 562c7a
  independently and only coerce the final result of the whole expression
Packit 562c7a
  to the target type (e.g. the type on the left side of an assignment).
Packit 562c7a
  This also avoids reference counting overhead for Python values during
Packit 562c7a
  evaluation and generally improves the code flow in the generated C code.
Packit 562c7a
Packit 562c7a
* The Python expression "2 ** N" is optimised into bit shifting.
Packit 562c7a
  See http://bugs.python.org/issue21420
Packit 562c7a
Packit 562c7a
* Cascaded assignments (a = b = ...) try to minimise the number of
Packit 562c7a
  type coercions.
Packit 562c7a
Packit 562c7a
* Calls to ``slice()`` are translated to a straight C-API call.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Crash when assigning memory views from ternary conditional expressions.
Packit 562c7a
Packit 562c7a
* Nested C++ templates could lead to unseparated ">>" characters being
Packit 562c7a
  generated into the C++ declarations, which older C++ compilers could
Packit 562c7a
  not parse.
Packit 562c7a
Packit 562c7a
* Sending SIGINT (Ctrl-C) during parallel cythonize() builds could
Packit 562c7a
  hang the child processes.
Packit 562c7a
Packit 562c7a
* No longer ignore local setup.cfg files for distutils in pyximport.
Packit 562c7a
  Patch by Martin Teichmann.
Packit 562c7a
Packit 562c7a
* Taking a ``char*`` from an indexed Python string generated unsafe
Packit 562c7a
  reference counting code.
Packit 562c7a
Packit 562c7a
* Set literals now create all of their items before trying to add them
Packit 562c7a
  to the set, following the behaviour in CPython.  This makes a
Packit 562c7a
  difference in the rare case that the item creation has side effects
Packit 562c7a
  and some items are not hashable (or if hashing them has side effects,
Packit 562c7a
  too).
Packit 562c7a
Packit 562c7a
* Cython no longer generates the cross product of C functions for code
Packit 562c7a
  that uses memory views of fused types in function signatures (e.g.
Packit 562c7a
  ``cdef func(floating[:] a, floating[:] b)``).  This is considered the
Packit 562c7a
  expected behaviour by most users and was previously inconsistent with
Packit 562c7a
  other structured types like C arrays.  Code that really wants all type
Packit 562c7a
  combinations can create the same fused memoryview type under different
Packit 562c7a
  names and use those in the signature to make it clear which types are
Packit 562c7a
  independent.
Packit 562c7a
Packit 562c7a
* Names that were unknown at compile time were looked up as builtins at
Packit 562c7a
  runtime but not as global module names.  Trying both lookups helps with
Packit 562c7a
  globals() manipulation.
Packit 562c7a
Packit 562c7a
* Fixed stl container conversion for typedef element types.
Packit 562c7a
Packit 562c7a
* ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.
Packit 562c7a
Packit 562c7a
* ``__init__.pyc`` is recognised as marking a package directory
Packit 562c7a
  (in addition to .py, .pyx and .pxd).
Packit 562c7a
Packit 562c7a
* Syntax highlighting in ``cython-mode.el`` for Emacs no longer
Packit 562c7a
  incorrectly highlights keywords found as part of longer names.
Packit 562c7a
Packit 562c7a
* Correctly handle ``from cython.submodule cimport name``.
Packit 562c7a
Packit 562c7a
* Fix infinite recursion when using super with cpdef methods.
Packit 562c7a
Packit 562c7a
* No-args ``dir()`` was not guaranteed to return a sorted list.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The header line in the generated C files no longer contains the
Packit 562c7a
  timestamp but only the Cython version that wrote it.  This was
Packit 562c7a
  changed to make builds more reproducible.
Packit 562c7a
Packit 562c7a
* Removed support for CPython 2.4, 2.5 and 3.1.
Packit 562c7a
Packit 562c7a
* The licensing implications on the generated code were clarified
Packit 562c7a
  to avoid legal constraints for users.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.20.2 (2014-06-16)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Some optimisations for set/frozenset instantiation.
Packit 562c7a
Packit 562c7a
* Support for C++ unordered_set and unordered_map.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Access to attributes of optimised builtin methods (e.g.
Packit 562c7a
  ``[].append.__name__``) could fail to compile.
Packit 562c7a
Packit 562c7a
* Memory leak when extension subtypes add a memory view as attribute
Packit 562c7a
  to those of the parent type without having Python object attributes
Packit 562c7a
  or a user provided dealloc method.
Packit 562c7a
Packit 562c7a
* Compiler crash on readonly properties in "binding" mode.
Packit 562c7a
Packit 562c7a
* Auto-encoding with ``c_string_encoding=ascii`` failed in Py3.3.
Packit 562c7a
Packit 562c7a
* Crash when subtyping freelist enabled Cython extension types with
Packit 562c7a
  Python classes that use ``__slots__``.
Packit 562c7a
Packit 562c7a
* Freelist usage is restricted to CPython to avoid problems with other
Packit 562c7a
  Python implementations.
Packit 562c7a
Packit 562c7a
* Memory leak in memory views when copying overlapping, contiguous slices.
Packit 562c7a
Packit 562c7a
* Format checking when requesting non-contiguous buffers from
Packit 562c7a
  ``cython.array`` objects was accidentally omitted in Py3.
Packit 562c7a
Packit 562c7a
* C++ destructor calls in extension types could fail to compile in clang.
Packit 562c7a
Packit 562c7a
* Buffer format validation failed for sequences of strings in structs.
Packit 562c7a
Packit 562c7a
* Docstrings on extension type attributes in .pxd files were rejected.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.20.1 (2014-02-11)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Build error under recent MacOS-X versions where ``isspace()`` could not be
Packit 562c7a
  resolved by clang.
Packit 562c7a
Packit 562c7a
* List/Tuple literals multiplied by more than one factor were only multiplied
Packit 562c7a
  by the last factor instead of all.
Packit 562c7a
Packit 562c7a
* Lookups of special methods (specifically for context managers) could fail
Packit 562c7a
  in Python <= 2.6/3.1.
Packit 562c7a
Packit 562c7a
* Local variables were erroneously appended to the signature introspection
Packit 562c7a
  of Cython implemented functions with keyword-only arguments under Python 3.
Packit 562c7a
Packit 562c7a
* In-place assignments to variables with inferred Python builtin/extension
Packit 562c7a
  types could fail with type errors if the result value type was incompatible
Packit 562c7a
  with the type of the previous value.
Packit 562c7a
Packit 562c7a
* The C code generation order of cdef classes, closures, helper code,
Packit 562c7a
  etc. was not deterministic, thus leading to high code churn.
Packit 562c7a
Packit 562c7a
* Type inference could fail to deduce C enum types.
Packit 562c7a
Packit 562c7a
* Type inference could deduce unsafe or inefficient types from integer
Packit 562c7a
  assignments within a mix of inferred Python variables and integer
Packit 562c7a
  variables.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.20 (2014-01-18)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Support for CPython 3.4.
Packit 562c7a
Packit 562c7a
* Support for calling C++ template functions.
Packit 562c7a
Packit 562c7a
* ``yield`` is supported in ``finally`` clauses.
Packit 562c7a
Packit 562c7a
* The C code generated for finally blocks is duplicated for each exit
Packit 562c7a
  case to allow for better optimisations by the C compiler.
Packit 562c7a
Packit 562c7a
* Cython tries to undo the Python optimisationism of assigning a bound
Packit 562c7a
  method to a local variable when it can generate better code for the
Packit 562c7a
  direct call.
Packit 562c7a
Packit 562c7a
* Constant Python float values are cached.
Packit 562c7a
Packit 562c7a
* String equality comparisons can use faster type specific code in
Packit 562c7a
  more cases than before.
Packit 562c7a
Packit 562c7a
* String/Unicode formatting using the '%' operator uses a faster
Packit 562c7a
  C-API call.
Packit 562c7a
Packit 562c7a
* ``bytearray`` has become a known type and supports coercion from and
Packit 562c7a
  to C strings.  Indexing, slicing and decoding is optimised. Note that
Packit 562c7a
  this may have an impact on existing code due to type inference.
Packit 562c7a
Packit 562c7a
* Using ``cdef basestring stringvar`` and function arguments typed as
Packit 562c7a
  ``basestring`` is now meaningful and allows assigning exactly
Packit 562c7a
  ``str`` and ``unicode`` objects, but no subtypes of these types.
Packit 562c7a
Packit 562c7a
* Support for the ``__debug__`` builtin.
Packit 562c7a
Packit 562c7a
* Assertions in Cython compiled modules are disabled if the running
Packit 562c7a
  Python interpreter was started with the "-O" option.
Packit 562c7a
Packit 562c7a
* Some types that Cython provides internally, such as functions and
Packit 562c7a
  generators, are now shared across modules if more than one Cython
Packit 562c7a
  implemented module is imported.
Packit 562c7a
Packit 562c7a
* The type inference algorithm works more fine granular by taking the
Packit 562c7a
  results of the control flow analysis into account.
Packit 562c7a
Packit 562c7a
* A new script in ``bin/cythonize`` provides a command line frontend
Packit 562c7a
  to the cythonize() compilation function (including distutils build).
Packit 562c7a
Packit 562c7a
* The new extension type decorator ``@cython.no_gc_clear`` prevents
Packit 562c7a
  objects from being cleared during cyclic garbage collection, thus
Packit 562c7a
  making sure that object attributes are kept alive until deallocation.
Packit 562c7a
Packit 562c7a
* During cyclic garbage collection, attributes of extension types that
Packit 562c7a
  cannot create reference cycles due to their type (e.g. strings) are
Packit 562c7a
  no longer considered for traversal or clearing.  This can reduce the
Packit 562c7a
  processing overhead when searching for or cleaning up reference cycles.
Packit 562c7a
Packit 562c7a
* Package compilation (i.e. ``__init__.py`` files) now works, starting
Packit 562c7a
  with Python 3.3.
Packit 562c7a
Packit 562c7a
* The cython-mode.el script for Emacs was updated.  Patch by Ivan Andrus.
Packit 562c7a
Packit 562c7a
* An option common_utility_include_dir was added to cythonize() to save
Packit 562c7a
  oft-used utility code once in a separate directory rather than as
Packit 562c7a
  part of each generated file.
Packit 562c7a
Packit 562c7a
* ``unraisable_tracebacks`` directive added to control printing of
Packit 562c7a
  tracebacks of unraisable exceptions.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Abstract Python classes that subtyped a Cython extension type
Packit 562c7a
  failed to raise an exception on instantiation, and thus ended
Packit 562c7a
  up being instantiated.
Packit 562c7a
Packit 562c7a
* ``set.add(a_tuple)`` and ``set.discard(a_tuple)`` failed with a
Packit 562c7a
  TypeError in Py2.4.
Packit 562c7a
Packit 562c7a
* The PEP 3155 ``__qualname__`` was incorrect for nested classes and
Packit 562c7a
  inner classes/functions declared as ``global``.
Packit 562c7a
Packit 562c7a
* Several corner cases in the try-finally statement were fixed.
Packit 562c7a
Packit 562c7a
* The metaclass of a Python class was not inherited from its parent
Packit 562c7a
  class(es).  It is now extracted from the list of base classes if not
Packit 562c7a
  provided explicitly using the Py3 ``metaclass`` keyword argument.
Packit 562c7a
  In Py2 compilation mode, a ``__metaclass__`` entry in the class
Packit 562c7a
  dict will still take precedence if not using Py3 metaclass syntax,
Packit 562c7a
  but only *after* creating the class dict (which may have been done
Packit 562c7a
  by a metaclass of a base class, see PEP 3115).  It is generally
Packit 562c7a
  recommended to use the explicit Py3 syntax to define metaclasses
Packit 562c7a
  for Python types at compile time.
Packit 562c7a
Packit 562c7a
* The automatic C switch statement generation behaves more safely for
Packit 562c7a
  heterogeneous value types (e.g. mixing enum and char), allowing for
Packit 562c7a
  a slightly wider application and reducing corner cases.  It now always
Packit 562c7a
  generates a 'default' clause to avoid C compiler warnings about
Packit 562c7a
  unmatched enum values.
Packit 562c7a
Packit 562c7a
* Fixed a bug where class hierarchies declared out-of-order could result
Packit 562c7a
  in broken generated code.
Packit 562c7a
Packit 562c7a
* Fixed a bug which prevented overriding const methods of C++ classes.
Packit 562c7a
Packit 562c7a
* Fixed a crash when converting Python objects to C++ strings fails.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* In Py3 compilation mode, Python2-style metaclasses declared by a
Packit 562c7a
  ``__metaclass__`` class dict entry are ignored.
Packit 562c7a
Packit 562c7a
* In Py3.4+, the Cython generator type uses ``tp_finalize()`` for safer
Packit 562c7a
  cleanup instead of ``tp_del()``.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.19.2 (2013-10-13)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Some standard declarations were fixed or updated, including the previously
Packit 562c7a
  incorrect declaration of ``PyBuffer_FillInfo()`` and some missing bits in
Packit 562c7a
  ``libc.math``.
Packit 562c7a
Packit 562c7a
* Heap allocated subtypes of ``type`` used the wrong base type struct at the
Packit 562c7a
  C level.
Packit 562c7a
Packit 562c7a
* Calling the unbound method dict.keys/value/items() in dict subtypes could
Packit 562c7a
  call the bound object method instead of the unbound supertype method.
Packit 562c7a
Packit 562c7a
* "yield" wasn't supported in "return" value expressions.
Packit 562c7a
Packit 562c7a
* Using the "bint" type in memory views lead to unexpected results.
Packit 562c7a
  It is now an error.
Packit 562c7a
Packit 562c7a
* Assignments to global/closure variables could catch them in an illegal state
Packit 562c7a
  while deallocating the old value.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.19.1 (2013-05-11)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Completely empty C-API structs for extension type slots (protocols like
Packit 562c7a
  number/mapping/sequence) are no longer generated into the C code.
Packit 562c7a
Packit 562c7a
* Docstrings that directly follow a public/readonly attribute declaration
Packit 562c7a
  in a cdef class will be used as docstring of the auto-generated property.
Packit 562c7a
  This fixes ticket 206.
Packit 562c7a
Packit 562c7a
* The automatic signature documentation tries to preserve more semantics
Packit 562c7a
  of default arguments and argument types.  Specifically, ``bint`` arguments
Packit 562c7a
  now appear as type ``bool``.
Packit 562c7a
Packit 562c7a
* A warning is emitted when negative literal indices are found inside of
Packit 562c7a
  a code section that disables ``wraparound`` handling.  This helps with
Packit 562c7a
  fixing invalid code that might fail in the face of future compiler
Packit 562c7a
  optimisations.
Packit 562c7a
Packit 562c7a
* Constant folding for boolean expressions (and/or) was improved.
Packit 562c7a
Packit 562c7a
* Added a build_dir option to cythonize() which allows one to place
Packit 562c7a
  the generated .c files outside the source tree.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* ``isinstance(X, type)`` failed to get optimised into a call to
Packit 562c7a
  ``PyType_Check()``, as done for other builtin types.
Packit 562c7a
Packit 562c7a
* A spurious ``from datetime cimport *`` was removed from the "cpython"
Packit 562c7a
  declaration package. This means that the "datetime" declarations
Packit 562c7a
  (added in 0.19) are no longer available directly from the "cpython"
Packit 562c7a
  namespace, but only from "cpython.datetime". This is the correct
Packit 562c7a
  way of doing it because the declarations refer to a standard library
Packit 562c7a
  module, not the core CPython C-API itself.
Packit 562c7a
Packit 562c7a
* The C code for extension types is now generated in topological order
Packit 562c7a
  instead of source code order to avoid C compiler errors about missing
Packit 562c7a
  declarations for subtypes that are defined before their parent.
Packit 562c7a
Packit 562c7a
* The ``memoryview`` type name no longer shows up in the module dict of
Packit 562c7a
  modules that use memory views.  This fixes trac ticket 775.
Packit 562c7a
Packit 562c7a
* Regression in 0.19 that rejected valid C expressions from being used
Packit 562c7a
  in C array size declarations.
Packit 562c7a
Packit 562c7a
* In C++ mode, the C99-only keyword ``restrict`` could accidentally be
Packit 562c7a
  seen by the GNU C++ compiler. It is now specially handled for both
Packit 562c7a
  GCC and MSVC.
Packit 562c7a
Packit 562c7a
* Testing large (> int) C integer values for their truth value could fail
Packit 562c7a
  due to integer wrap-around.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.19 (2013-04-19)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* New directives ``c_string_type`` and ``c_string_encoding`` to more easily
Packit 562c7a
  and automatically convert between C strings and the different Python string
Packit 562c7a
  types.
Packit 562c7a
Packit 562c7a
* The extension type flag ``Py_TPFLAGS_HAVE_VERSION_TAG`` is enabled by default
Packit 562c7a
  on extension types and can be disabled using the ``type_version_tag`` compiler
Packit 562c7a
  directive.
Packit 562c7a
Packit 562c7a
* EXPERIMENTAL support for simple Cython code level line tracing.  Enabled by
Packit 562c7a
  the "linetrace" compiler directive.
Packit 562c7a
Packit 562c7a
* Cython implemented functions make their argument and return type annotations
Packit 562c7a
  available through the ``__annotations__`` attribute (PEP 3107).
Packit 562c7a
Packit 562c7a
* Access to non-cdef module globals and Python object attributes is faster.
Packit 562c7a
Packit 562c7a
* ``Py_UNICODE*`` coerces from and to Python unicode strings.  This is
Packit 562c7a
  helpful when talking to Windows APIs, which use compatible wchar_t
Packit 562c7a
  arrays for strings.  Note that the ``Py_UNICODE`` type is otherwise
Packit 562c7a
  deprecated as of CPython 3.3.
Packit 562c7a
Packit 562c7a
* ``isinstance(obj, basestring)`` is optimised.  In Python 3 it only tests
Packit 562c7a
  for instances of ``str`` (i.e. Py2 ``unicode``).
Packit 562c7a
Packit 562c7a
* The ``basestring`` builtin is mapped to ``str`` (i.e. Py2 ``unicode``) when
Packit 562c7a
  compiling the generated C code under Python 3.
Packit 562c7a
Packit 562c7a
* Closures use freelists, which can speed up their creation quite substantially.
Packit 562c7a
  This is also visible for short running generator expressions, for example.
Packit 562c7a
Packit 562c7a
* A new class decorator ``@cython.freelist(N)`` creates a static freelist of N
Packit 562c7a
  instances for an extension type, thus avoiding the costly allocation step if
Packit 562c7a
  possible. This can speed up object instantiation by 20-30% in suitable
Packit 562c7a
  scenarios. Note that freelists are currently only supported for base types,
Packit 562c7a
  not for types that inherit from others.
Packit 562c7a
Packit 562c7a
* Fast extension type instantiation using the ``Type.__new__(Type)`` idiom has
Packit 562c7a
  gained support for passing arguments.  It is also a bit faster for types defined
Packit 562c7a
  inside of the module.
Packit 562c7a
Packit 562c7a
* The Python2-only dict methods ``.iter*()`` and ``.view*()`` (requires Python 2.7)
Packit 562c7a
  are automatically mapped to the equivalent keys/values/items methods in Python 3
Packit 562c7a
  for typed dictionaries.
Packit 562c7a
Packit 562c7a
* Slicing unicode strings, lists and tuples is faster.
Packit 562c7a
Packit 562c7a
* list.append() is faster on average.
Packit 562c7a
Packit 562c7a
* ``raise Exception() from None`` suppresses the exception context in Py3.3.
Packit 562c7a
Packit 562c7a
* Py3 compatible ``exec(tuple)`` syntax is supported in Py2 code.
Packit 562c7a
Packit 562c7a
* Keyword arguments are supported for cdef functions.
Packit 562c7a
Packit 562c7a
* External C++ classes can be declared nogil.  Patch by John Stumpo.  This fixes
Packit 562c7a
  trac ticket 805.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* 2-value slicing of unknown objects passes the correct slice when the ``getitem``
Packit 562c7a
  protocol is used instead of the ``getslice`` protocol (especially in Python 3),
Packit 562c7a
  i.e. ``None`` values for missing bounds instead of ``[0,maxsize]``.  It is also
Packit 562c7a
  a bit faster in some cases, e.g. for constant bounds.  This fixes trac ticket 636.
Packit 562c7a
Packit 562c7a
* Cascaded assignments of None values to extension type variables failed with
Packit 562c7a
  a ``TypeError`` at runtime.
Packit 562c7a
Packit 562c7a
* The ``__defaults__`` attribute was not writable for Cython implemented
Packit 562c7a
  functions.
Packit 562c7a
Packit 562c7a
* Default values of keyword-only arguments showed up in ``__defaults__`` instead
Packit 562c7a
  of ``__kwdefaults__`` (which was not implemented).  Both are available for
Packit 562c7a
  Cython implemented functions now, as specified in Python 3.x.
Packit 562c7a
Packit 562c7a
* ``yield`` works inside of ``with gil`` sections.  It previously lead to a crash.
Packit 562c7a
  This fixes trac ticket 803.
Packit 562c7a
Packit 562c7a
* Static methods without explicitly named positional arguments (e.g. having only
Packit 562c7a
  ``*args``) crashed when being called.  This fixes trac ticket 804.
Packit 562c7a
Packit 562c7a
* ``dir()`` without arguments previously returned an unsorted list, which now
Packit 562c7a
  gets sorted as expected.
Packit 562c7a
Packit 562c7a
* ``dict.items()``, ``dict.keys()`` and ``dict.values()`` no longer return lists
Packit 562c7a
  in Python 3.
Packit 562c7a
Packit 562c7a
* Exiting from an ``except-as`` clause now deletes the exception in Python 3 mode.
Packit 562c7a
Packit 562c7a
* The declarations of ``frexp()`` and ``ldexp()`` in ``math.pxd`` were incorrect.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.18 (2013-01-28)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Named Unicode escapes ("\N{...}") are supported.
Packit 562c7a
Packit 562c7a
* Python functions/classes provide the special attribute "__qualname__"
Packit 562c7a
  as defined by PEP 3155.
Packit 562c7a
Packit 562c7a
* Added a directive ``overflowcheck`` which raises an OverflowException when
Packit 562c7a
  arithmetic with C ints overflow.  This has a modest performance penalty, but
Packit 562c7a
  is much faster than using Python ints.
Packit 562c7a
Packit 562c7a
* Calls to nested Python functions are resolved at compile time.
Packit 562c7a
Packit 562c7a
* Type inference works across nested functions.
Packit 562c7a
Packit 562c7a
* ``py_bytes_string.decode(...)`` is optimised.
Packit 562c7a
Packit 562c7a
* C ``const`` declarations are supported in the language.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Automatic C++ exception mapping didn't work in nogil functions (only in
Packit 562c7a
  "with nogil" blocks).
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.17.4 (2013-01-03)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Garbage collection triggered during deallocation of container classes could lead to a double-deallocation.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.17.3 (2012-12-14)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* During final interpreter cleanup (with types cleanup enabled at compile time), extension types that inherit from base types over more than one level that were cimported from other modules could lead to a crash.
Packit 562c7a
Packit 562c7a
* Weak-reference support in extension types (with a ``cdef __weakref__`` attribute) generated incorrect deallocation code.
Packit 562c7a
Packit 562c7a
* In CPython 3.3, converting a Unicode character to the Py_UNICODE type could fail to raise an overflow for non-BMP characters that do not fit into a wchar_t on the current platform.
Packit 562c7a
Packit 562c7a
* Negative C integer constants lost their longness suffix in the generated C code.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.17.2 (2012-11-20)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* ``cythonize()`` gained a best effort compile mode that can be used to simply ignore .py files that fail to compile.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Replacing an object reference with the value of one of its cdef attributes could generate incorrect C code that accessed the object after deleting its last reference.
Packit 562c7a
Packit 562c7a
* C-to-Python type coercions during cascaded comparisons could generate invalid C code, specifically when using the 'in' operator.
Packit 562c7a
Packit 562c7a
* "obj[1,]" passed a single integer into the item getter instead of a tuple.
Packit 562c7a
Packit 562c7a
* Cyclic imports at module init time did not work in Py3.
Packit 562c7a
Packit 562c7a
* The names of C++ destructors for template classes were built incorrectly.
Packit 562c7a
Packit 562c7a
* In pure mode, type casts in Cython syntax and the C ampersand operator are now rejected. Use the pure mode replacements instead.
Packit 562c7a
Packit 562c7a
* In pure mode, C type names and the sizeof() function are no longer recognised as such and can be used as normal Python names.
Packit 562c7a
Packit 562c7a
* The extended C level support for the CPython array type was declared too late to be used by user defined classes.
Packit 562c7a
Packit 562c7a
* C++ class nesting was broken.
Packit 562c7a
Packit 562c7a
* Better checking for required nullary constructors for stack-allocated C++ instances.
Packit 562c7a
Packit 562c7a
* Remove module docstring in no-docstring mode.
Packit 562c7a
Packit 562c7a
* Fix specialization for varargs function signatures.
Packit 562c7a
Packit 562c7a
* Fix several compiler crashes.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* An experimental distutils script for compiling the CPython standard library was added as Tools/cystdlib.py.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.17.1 (2012-09-26)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* A reference leak was fixed in the new dict iteration code when the loop target was not a plain variable but an unpacked tuple.
Packit 562c7a
Packit 562c7a
* Memory views did not handle the special case of a NULL buffer strides value, as allowed by PEP3118.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.17 (2012-09-01)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Alpha quality support for compiling and running Cython generated extension modules in PyPy (through cpyext). Note that this requires at least PyPy 1.9 and in many cases also adaptations in user code, especially to avoid borrowed references when no owned reference is being held directly in C space (a reference in a Python list or dict is not enough, for example). See the documentation on porting Cython code to PyPy.
Packit 562c7a
Packit 562c7a
* "yield from" is supported (PEP 380) and a couple of minor problems with generators were fixed.
Packit 562c7a
Packit 562c7a
* C++ STL container classes automatically coerce from and to the equivalent Python container types on typed assignments and casts. Note that the data in the containers is copied during this conversion.
Packit 562c7a
Packit 562c7a
* C++ iterators can now be iterated over using "for x in cpp_container" whenever cpp_container has begin() and end() methods returning objects satisfying the iterator pattern (that is, it can be incremented, dereferenced, and compared (for non-equality)).
Packit 562c7a
Packit 562c7a
* cdef classes can now have C++ class members (provided a zero-argument constructor exists)
Packit 562c7a
Packit 562c7a
* A new cpython.array standard cimport file allows to efficiently talk to the stdlib array.array data type in Python 2. Since CPython does not export an official C-API for this module, it receives special casing by the compiler in order to avoid setup overhead on user side. In Python 3, both buffers and memory views on the array type already worked out of the box with earlier versions of Cython due to the native support for the buffer interface in the Py3 array module.
Packit 562c7a
Packit 562c7a
* Fast dict iteration is now enabled optimistically also for untyped variables when the common iteration methods are used.
Packit 562c7a
Packit 562c7a
* The unicode string processing code was adapted for the upcoming CPython 3.3 (PEP 393, new Unicode buffer layout).
Packit 562c7a
Packit 562c7a
* Buffer arguments and memory view arguments in Python functions can be declared "not None" to raise a TypeError on None input.
Packit 562c7a
Packit 562c7a
* c(p)def functions in pure mode can specify their return type with "@cython.returns()".
Packit 562c7a
Packit 562c7a
* Automatic dispatch for fused functions with memoryview arguments
Packit 562c7a
Packit 562c7a
* Support newaxis indexing for memoryviews
Packit 562c7a
Packit 562c7a
* Support decorators for fused functions
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Old-style Py2 imports did not work reliably in Python 3.x and were broken in Python 3.3. Regardless of this fix, it's generally best to be explicit about relative and global imports in Cython code because old-style imports have a higher overhead. To this end, "from __future__ import absolute_import" is supported in Python/Cython 2.x code now (previous versions of Cython already used it when compiling Python 3 code).
Packit 562c7a
Packit 562c7a
* Stricter constraints on the "inline" and "final" modifiers. If your code does not compile due to this change, chances are these modifiers were previously being ignored by the compiler and can be removed without any performance regression.
Packit 562c7a
Packit 562c7a
* Exceptions are always instantiated while raising them (as in Python), instead of risking to instantiate them in potentially unsafe situations when they need to be handled or otherwise processed.
Packit 562c7a
Packit 562c7a
* locals() properly ignores names that do not have Python compatible types (including automatically inferred types).
Packit 562c7a
Packit 562c7a
* Some garbage collection issues of memory views were fixed.
Packit 562c7a
Packit 562c7a
* numpy.pxd compiles in Python 3 mode.
Packit 562c7a
Packit 562c7a
* Several C compiler warnings were fixed.
Packit 562c7a
Packit 562c7a
* Several bugs related to memoryviews and fused types were fixed.
Packit 562c7a
Packit 562c7a
* Several bug-fixes and improvements related to cythonize(), including ccache-style caching.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* libc.string provides a convenience declaration for const uchar in addition to const char.
Packit 562c7a
Packit 562c7a
* User declared char* types are now recognised as such and auto-coerce to and from Python bytes strings.
Packit 562c7a
Packit 562c7a
* callable() and next() compile to more efficient C code.
Packit 562c7a
Packit 562c7a
* list.append() is faster on average.
Packit 562c7a
Packit 562c7a
* Modules generated by @cython.inline() are written into the directory pointed to by the environment variable CYTHON_CACHE_DIR if set.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.16 (2012-04-21)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Enhancements to Cython's function type (support for weak references, default arguments, code objects, dynamic attributes, classmethods, staticmethods, and more)
Packit 562c7a
Packit 562c7a
* Fused Types - Template-like support for functions and methods CEP 522 (docs)
Packit 562c7a
Packit 562c7a
* Typed views on memory - Support for efficient direct and indirect buffers (indexing, slicing, transposing, ...) CEP 517 (docs)
Packit 562c7a
Packit 562c7a
* super() without arguments
Packit 562c7a
Packit 562c7a
* Final cdef methods (which translate into direct calls on known instances)
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* fix alignment handling for record types in buffer support
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* support default arguments for closures
Packit 562c7a
Packit 562c7a
* search sys.path for pxd files
Packit 562c7a
Packit 562c7a
* support C++ template casting
Packit 562c7a
Packit 562c7a
* faster traceback building and faster generator termination
Packit 562c7a
Packit 562c7a
* support inplace operators on indexed buffers
Packit 562c7a
Packit 562c7a
* allow nested prange sections
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.15.1 (2011-09-19)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.15 (2011-08-05)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Generators (yield) - Cython has full support for generators, generator expressions and PEP 342 coroutines.
Packit 562c7a
Packit 562c7a
* The nonlocal keyword is supported.
Packit 562c7a
Packit 562c7a
* Re-acquiring the gil: with gil - works as expected within a nogil context.
Packit 562c7a
Packit 562c7a
* OpenMP support: prange.
Packit 562c7a
Packit 562c7a
* Control flow analysis prunes dead code and emits warnings and errors about uninitialised variables.
Packit 562c7a
Packit 562c7a
* Debugger command cy set to assign values of expressions to Cython variables and cy exec counterpart $cy_eval().
Packit 562c7a
Packit 562c7a
* Exception chaining PEP 3134.
Packit 562c7a
Packit 562c7a
* Relative imports PEP 328.
Packit 562c7a
Packit 562c7a
* Improved pure syntax including cython.cclass, cython.cfunc, and cython.ccall.
Packit 562c7a
Packit 562c7a
* The with statement has its own dedicated and faster C implementation.
Packit 562c7a
Packit 562c7a
* Support for del.
Packit 562c7a
Packit 562c7a
* Boundschecking directives implemented for builtin Python sequence types.
Packit 562c7a
Packit 562c7a
* Several updates and additions to the shipped standard library .pxd files.
Packit 562c7a
Packit 562c7a
* Forward declaration of types is no longer required for circular references.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Uninitialized variables are no longer initialized to None and accessing them has the same semantics as standard Python.
Packit 562c7a
Packit 562c7a
* globals() now returns a read-only dict of the Cython module's globals, rather than the globals of the first non-Cython module in the stack
Packit 562c7a
Packit 562c7a
* Many C++ exceptions are now special cased to give closer Python counterparts. This means that except+ functions that formerly raised generic RuntimeErrors may raise something else such as ArithmeticError.
Packit 562c7a
Packit 562c7a
* The inlined generator expressions (introduced in Cython 0.13) were disabled in favour of full generator expression support. This breaks code that previously used them inside of cdef functions (usage in def functions continues to work) and induces a performance regression for cases that continue to work but that were previously inlined. We hope to reinstate this feature in the near future.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.14.1 (2011-02-04)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* The gdb debugging support was extended to include all major Cython features, including closures.
Packit 562c7a
Packit 562c7a
* raise MemoryError() is now safe to use as Cython replaces it with the correct C-API call.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Decorators on special methods of cdef classes now raise a compile time error rather than being ignored.
Packit 562c7a
Packit 562c7a
* In Python 3 language level mode (-3 option), the 'str' type is now mapped to 'unicode', so that cdef str s declares a Unicode string even when running in Python 2.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.14 (2010-12-14)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Python classes can now be nested and receive a proper closure at definition time.
Packit 562c7a
Packit 562c7a
* Redefinition is supported for Python functions, even within the same scope.
Packit 562c7a
Packit 562c7a
* Lambda expressions are supported in class bodies and at the module level.
Packit 562c7a
Packit 562c7a
* Metaclasses are supported for Python classes, both in Python 2 and Python 3 syntax. The Python 3 syntax (using a keyword argument in the type declaration) is preferred and optimised at compile time.
Packit 562c7a
Packit 562c7a
* "final" extension classes prevent inheritance in Python space. This feature is available through the new "cython.final" decorator. In the future, these classes may receive further optimisations.
Packit 562c7a
Packit 562c7a
* "internal" extension classes do not show up in the module dictionary. This feature is available through the new "cython.internal" decorator.
Packit 562c7a
Packit 562c7a
* Extension type inheritance from builtin types, such as "cdef class MyUnicode(unicode)", now works without further external type redeclarations (which are also strongly discouraged now and continue to issue a warning).
Packit 562c7a
Packit 562c7a
* GDB support. http://docs.cython.org/src/userguide/debugging.html
Packit 562c7a
Packit 562c7a
* A new build system with support for inline distutils directives, correct dependency tracking, and parallel compilation. http://wiki.cython.org/enhancements/distutils_preprocessing
Packit 562c7a
Packit 562c7a
* Support for dynamic compilation at runtime via the new cython.inline function and cython.compile decorator. http://wiki.cython.org/enhancements/inline
Packit 562c7a
Packit 562c7a
* "nogil" blocks are supported when compiling pure Python code by writing "with cython.nogil".
Packit 562c7a
Packit 562c7a
* Iterating over arbitrary pointer types is now supported, as is an optimized version of the in operator, e.g. x in ptr[a:b].
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* In parallel assignments, the right side was evaluated in reverse order in 0.13. This could result in errors if it had side effects (e.g. function calls).
Packit 562c7a
Packit 562c7a
* In some cases, methods of builtin types would raise a SystemError instead of an AttributeError when called on None.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Constant tuples are now cached over the lifetime of an extension module, just like CPython does. Constant argument tuples of Python function calls are also cached.
Packit 562c7a
Packit 562c7a
* Closures have tightened to include exactly the names used in the inner functions and classes. Previously, they held the complete locals of the defining function.
Packit 562c7a
Packit 562c7a
* The builtin "next()" function in Python 2.6 and later is now implemented internally and therefore available in all Python versions. This makes it the preferred and portable way of manually advancing an iterator.
Packit 562c7a
Packit 562c7a
* In addition to the previously supported inlined generator expressions in 0.13, "sorted(genexpr)" can now be used as well. Typing issues were fixed in "sum(genexpr)" that could lead to invalid C code being generated. Other known issues with inlined generator expressions were also fixed that make upgrading to 0.14 a strong recommendation for code that uses them. Note that general generators and generator expressions continue to be not supported.
Packit 562c7a
Packit 562c7a
* Inplace arithmetic operators now respect the cdivision directive and are supported for complex types.
Packit 562c7a
Packit 562c7a
* Typing a variable as type "complex" previously gave it the Python object type. It now uses the appropriate C/C++ double complex type. A side-effect is that assignments and typed function parameters now accept anything that Python can coerce to a complex, including integers and floats, and not only complex instances.
Packit 562c7a
Packit 562c7a
* Large integer literals pass through the compiler in a safer way. To prevent truncation in C code, non 32-bit literals are turned into Python objects if not used in a C context. This context can either be given by a clear C literal suffix such as "UL" or "LL" (or "L" in Python 3 code), or it can be an assignment to a typed variable or a typed function argument, in which case it is up to the user to take care of a sufficiently large value space of the target.
Packit 562c7a
Packit 562c7a
* Python functions are declared in the order they appear in the file, rather than all being created at module creation time. This is consistent with Python and needed to support, for example, conditional or repeated declarations of functions. In the face of circular imports this may cause code to break, so a new --disable-function-redefinition flag was added to revert to the old behavior. This flag will be removed in a future release, so should only be used as a stopgap until old code can be fixed.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.13 (2010-08-25)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Closures are fully supported for Python functions. Cython supports inner functions and lambda expressions. Generators and generator expressions are not supported in this release.
Packit 562c7a
Packit 562c7a
* Proper C++ support. Cython knows about C++ classes, templates and overloaded function signatures, so that Cython code can interact with them in a straight forward way.
Packit 562c7a
Packit 562c7a
* Type inference is enabled by default for safe C types (e.g. double, bint, C++ classes) and known extension types. This reduces the need for explicit type declarations and can improve the performance of untyped code in some cases. There is also a verbose compile mode for testing the impact on user code.
Packit 562c7a
Packit 562c7a
* Cython's for-in-loop can iterate over C arrays and sliced pointers. The type of the loop variable will be inferred automatically in this case.
Packit 562c7a
Packit 562c7a
* The Py_UNICODE integer type for Unicode code points is fully supported, including for-loops and 'in' tests on unicode strings. It coerces from and to single character unicode strings. Note that untyped for-loop variables will automatically be inferred as Py_UNICODE when iterating over a unicode string. In most cases, this will be much more efficient than yielding sliced string objects, but can also have a negative performance impact when the variable is used in a Python context multiple times, so that it needs to coerce to a unicode string object more than once. If this happens, typing the loop variable as unicode or object will help.
Packit 562c7a
Packit 562c7a
* The built-in functions any(), all(), sum(), list(), set() and dict() are inlined as plain for loops when called on generator expressions. Note that generator expressions are not generally supported apart from this feature. Also, tuple(genexpr) is not currently supported - use tuple([listcomp]) instead.
Packit 562c7a
Packit 562c7a
* More shipped standard library declarations. The python_* and stdlib/stdio .pxd files have been deprecated in favor of clib.* and cpython[.*] and may get removed in a future release.
Packit 562c7a
Packit 562c7a
* Pure Python mode no longer disallows non-Python keywords like 'cdef', 'include' or 'cimport'. It also no longer recognises syntax extensions like the for-from loop.
Packit 562c7a
Packit 562c7a
* Parsing has improved for Python 3 syntax in Python code, although not all features are correctly supported. The missing Python 3 features are being worked on for the next release.
Packit 562c7a
Packit 562c7a
* from __future__ import print_function is supported in Python 2.6 and later. Note that there is currently no emulation for earlier Python versions, so code that uses print() with this future import will require at least Python 2.6.
Packit 562c7a
Packit 562c7a
* New compiler directive language_level (valid values: 2 or 3) with corresponding command line options -2 and -3 requests source code compatibility with Python 2.x or Python 3.x respectively. Language level 3 currently enforces unicode literals for unprefixed string literals, enables the print function (requires Python 2.6 or later) and keeps loop variables in list comprehensions from leaking.
Packit 562c7a
Packit 562c7a
* Loop variables in set/dict comprehensions no longer leak into the surrounding scope (following Python 2.7). List comprehensions are unchanged in language level 2.
Packit 562c7a
Packit 562c7a
* print >> stream
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* The availability of type inference by default means that Cython will also infer the type of pointers on assignments. Previously, code like this::
Packit 562c7a
Packit 562c7a
     cdef char* s = ...
Packit 562c7a
     untyped_variable = s
Packit 562c7a
Packit 562c7a
  would convert the char* to a Python bytes string and assign that. This is no longer the case and no coercion will happen in the example above. The correct way of doing this is through an explicit cast or by typing the target variable, i.e.
Packit 562c7a
Packit 562c7a
  ::
Packit 562c7a
Packit 562c7a
     cdef char* s = ...
Packit 562c7a
     untyped_variable1 = <bytes>s
Packit 562c7a
     untyped_variable2 = <object>s
Packit 562c7a
Packit 562c7a
     cdef object py_object = s
Packit 562c7a
     cdef bytes  bytes_string = s
Packit 562c7a
Packit 562c7a
* bool is no longer a valid type name by default. The problem is that it's not clear whether bool should refer to the Python type or the C++ type, and expecting one and finding the other has already led to several hard-to-find bugs. Both types are available for importing: you can use from cpython cimport bool for the Python bool type, and from libcpp cimport bool for the C++ type. bool is still a valid object by default, so one can still write bool(x).
Packit 562c7a
Packit 562c7a
* ``__getsegcount__`` is now correctly typed to take a ``Py_size_t*`` rather than an ``int*``.
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.12.1 (2010-02-02)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Type inference improvements.
Packit 562c7a
Packit 562c7a
  * There have been several bug fixes and improvements to the type inferencer.
Packit 562c7a
Packit 562c7a
  * Notably, there is now a "safe" mode enabled by setting the infer_types directive to None. (The None here refers to the "default" mode, which will be the default in 0.13.) This safe mode limits inference to Python object types and C doubles, which should speed up execution without affecting any semantics such as integer overflow behavior like infer_types=True might. There is also an infer_types.verbose option which allows one to see what types are inferred.
Packit 562c7a
Packit 562c7a
* The boundscheck directive works for lists and tuples as well as buffers.
Packit 562c7a
Packit 562c7a
* len(s) and s.decode("encoding") are efficiently supported for char* s.
Packit 562c7a
Packit 562c7a
* Cython's INLINE macro has been renamed to CYTHON_INLINE to reduce conflict and has better support for the MSVC compiler on Windows. It is no longer clobbered if externally defined.
Packit 562c7a
Packit 562c7a
* Revision history is now omitted from the source package, resulting in a 85% size reduction. Running make repo will download the history and turn the directory into a complete Mercurial working repository.
Packit 562c7a
Packit 562c7a
* Cython modules don't need to be recompiled when the size of an external type grows. (A warning, rather than an error, is produced.) This should be helpful for binary distributions relying on NumPy.
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Several other bugs and minor improvements have been made. This release should be fully backwards compatible with 0.12.
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.12 (2009-11-23)
Packit 562c7a
=================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* Type inference with the infer_types directive
Packit 562c7a
Packit 562c7a
* Seamless C++ complex support
Packit 562c7a
Packit 562c7a
* Fast extension type instantiation using the normal Python meme obj = MyType.__new__(MyType)
Packit 562c7a
Packit 562c7a
* Improved support for Py3.1
Packit 562c7a
Packit 562c7a
* Cython now runs under Python 3.x using the 2to3 tool
Packit 562c7a
Packit 562c7a
* unittest support for doctests in Cython modules
Packit 562c7a
Packit 562c7a
* Optimised handling of C strings (char*): for c in cstring[2:50] and cstring.decode()
Packit 562c7a
Packit 562c7a
* Looping over c pointers: for i in intptr[:50].
Packit 562c7a
Packit 562c7a
* pyximport improvements
Packit 562c7a
Packit 562c7a
* cython_freeze improvements
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
* Many bug fixes
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Many other optimisation, e.g. enumerate() loops, parallel swap assignments (a,b = b,a), and unicode.encode()
Packit 562c7a
Packit 562c7a
* More complete numpy.pxd
Packit 562c7a
Packit 562c7a
Packit 562c7a
0.11.2 (2009-05-20)
Packit 562c7a
===================
Packit 562c7a
Packit 562c7a
Features added
Packit 562c7a
--------------
Packit 562c7a
Packit 562c7a
* There's now native complex floating point support! C99 complex will be used if complex.h is included, otherwise explicit complex arithmetic working on all C compilers is used. [Robert Bradshaw]
Packit 562c7a
Packit 562c7a
  ::
Packit 562c7a
Packit 562c7a
      cdef double complex a = 1 + 0.3j
Packit 562c7a
      cdef np.ndarray[np.complex128_t, ndim=2] arr = \
Packit 562c7a
         np.zeros(10, np.complex128)
Packit 562c7a
Packit 562c7a
* Cython can now generate a main()-method for embedding of the Python interpreter into an executable (see #289) [Robert Bradshaw]
Packit 562c7a
Packit 562c7a
* @wraparound directive (another way to disable arr[idx] for negative idx) [Dag Sverre Seljebotn]
Packit 562c7a
Packit 562c7a
* Correct support for NumPy record dtypes with different alignments, and "cdef packed struct" support [Dag Sverre Seljebotn]
Packit 562c7a
Packit 562c7a
* @callspec directive, allowing custom calling convention macros [Lisandro Dalcin]
Packit 562c7a
Packit 562c7a
Bugs fixed
Packit 562c7a
----------
Packit 562c7a
Packit 562c7a
Other changes
Packit 562c7a
-------------
Packit 562c7a
Packit 562c7a
* Bug fixes and smaller improvements. For the full list, see [1].