Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 1224 lines (756 sloc) 47.821 kb
977c15c scoder added changelog file
scoder authored
1 ================
2 Cython Changelog
3 ================
4
4c865f3 scoder changelog
scoder authored
5 Latest changes
6 ==============
871377b scoder Fix crash when an exception occurs during module init and the stale modu...
scoder authored
7
29eb023 scoder implement coverage analysis support as a plugin for the coverage.py tool
scoder authored
8 Features added
9 --------------
10
11 * Support for coverage.py 4.0+ can be enabled by adding the plugin
12 "Cython.Coverage" to the ".coveragerc" config file.
13
476565c scoder changelog
scoder authored
14 * Annotated HTML source pages can integrate (XML) coverage reports.
15
a871a39 scoder changelog
scoder authored
16 * Tracing is supported in ``nogil`` functions/sections and module init code.
3b6ec99 scoder enable tracing for nogil functions/sections
scoder authored
17
29eb023 scoder implement coverage analysis support as a plugin for the coverage.py tool
scoder authored
18 Bugs fixed
19 ----------
20
a74bdd5 scoder make filename table relative to project root to actually allow finding t...
scoder authored
21 * Runtime reported file paths of source files (e.g for profiling and tracing)
22 are now relative to the build root directory instead of the main source file.
23
65840df scoder changelog
scoder authored
24 * Tracing exception handling code could enter the trace function with an active
25 exception set.
26
27 * Comparisons of (inferred) ctuples failed to compile.
28
9a70800 scoder fix comparison of function signatures that use C++ exception mappings
scoder authored
29 * C++ exception declarations with mapping functions could fail to compile when
30 pre-declared in .pxd files.
31
6c35aa7 scoder changelog
scoder authored
32 * C compilation could fail in pypy3.
33
a2a46a9 Robert Bradshaw Change notes.
robertwb authored
34
1fb644d Robert Bradshaw 0.22 release candidate
robertwb authored
35 0.22 (2015-02-11)
36 =================
a2a46a9 Robert Bradshaw Change notes.
robertwb authored
37
ee86071 scoder changelog
scoder authored
38 Features added
39 --------------
40
63a5d78 scoder changelog
scoder authored
41 * C functions can coerce to Python functions, which allows passing them
42 around as callable objects.
43
a0e2b42 scoder changelog
scoder authored
44 * C arrays can be assigned by value and auto-coerce from Python iterables
45 and to Python lists (and tuples).
3676e7a scoder changelog
scoder authored
46
d6f77d7 Robert Bradshaw Auto-wrap cpdef extern functions.
robertwb authored
47 * Extern C functions can now be declared as cpdef to export them to
48 the module's Python namespace. Extern C functions in pxd files export
49 their values to their own module, iff it exists.
50
26eed56 scoder fix changelog
scoder authored
51 * Anonymous C tuple types can be declared as (ctype1, ctype2, ...).
52
b4383a5 scoder implement PEP 479: replace accidental StopIteration exceptions that exit...
scoder authored
53 * PEP 479: turn accidental StopIteration exceptions that exit generators
54 into a RuntimeError, activated with future import "generator_stop".
55 See http://legacy.python.org/dev/peps/pep-0479/
56
7e89fa7 scoder changelog
scoder authored
57 * Looping over ``reversed(range())`` is optimised in the same way as
58 ``range()``. Patch by Favian Contreras.
59
4c865f3 scoder changelog
scoder authored
60 Bugs fixed
61 ----------
62
63 * Mismatching 'except' declarations on signatures in .pxd and .pyx files failed
64 to produce a compile error.
65
7e89fa7 scoder changelog
scoder authored
66 * Failure to find any files for the path pattern(s) passed into ``cythonize()``
67 is now an error to more easily detect accidental typos.
68
10bd329 Lars fix erroneous prototypes for npy_logaddexp*
larsmans authored
69 * The ``logaddexp`` family of functions in ``numpy.math`` now has correct
70 declarations.
71
2b76ed2 scoder changelog
scoder authored
72 * In Py2.6/7 and Py3.2, simple Cython memory views could accidentally be
73 interpreted as non-contiguous by CPython, which could trigger a CPython
74 bug when copying data from them, thus leading to data corruption.
75 See CPython issues 12834 and 23349.
76
4c865f3 scoder changelog
scoder authored
77 Other changes
78 -------------
79
a2a46a9 Robert Bradshaw Change notes.
robertwb authored
80 * Preliminary support for defining the Cython language with a formal grammar.
81 To try parsing your files against this grammar, use the --formal_grammar directive.
82 Experimental.
83
c66d14f scoder changelog
scoder authored
84 * ``_`` is no longer considered a cacheable builtin as it could interfere with
85 gettext.
86
b2538cd scoder typo
scoder authored
87 * Cythonize-computed metadata now cached in the generated C files.
8d62db6 Robert Bradshaw changelog
robertwb authored
88
89 * Several corrections and extensions in numpy, cpython, and libcpp pxd files.
75079c9 scoder exclude "_" from list of cacheable 'builtins' to improve compatibility w...
scoder authored
90
4c865f3 scoder changelog
scoder authored
91
efdbeef scoder prepare release of 0.21.2
scoder authored
92 0.21.2 (2014-12-27)
b77fee3 scoder changelog
scoder authored
93 ===================
94
95 Bugs fixed
96 ----------
97
98 * Crash when assigning a C value to both a Python and C target at the same time.
99
100 * Automatic coercion from C++ strings to ``str`` generated incomplete code that
101 failed to compile.
102
103 * Declaring a constructor in a C++ child class erroneously required a default
104 constructor declaration in the super class.
105
106 * ``resize_smart()`` in ``cpython.array`` was broken.
107
108 * Functions in ``libcpp.cast`` are now declared as ``nogil``.
109
110 * Some missing C-API declarations were added.
111
112 * Py3 main code in embedding program code was lacking casts.
113
6870ce0 scoder changelog
scoder authored
114 * Exception related to distutils "Distribution" class type in pyximport under
115 latest CPython 2.7 and 3.4 releases when setuptools is being imported later.
116
b77fee3 scoder changelog
scoder authored
117
4c865f3 scoder changelog
scoder authored
118 0.21.1 (2014-10-18)
119 ===================
120
121 Features added
122 --------------
123
124 * New ``cythonize`` option ``-a`` to generate the annotated HTML source view.
125
22a54c7 scoder extend PyUnicode C-API declarations
scoder authored
126 * Missing C-API declarations in ``cpython.unicode`` were added.
127
88df97f scoder implement'language='c++' option for cythonize()
scoder authored
128 * Passing ``language='c++'`` into cythonize() globally enables C++ mode for
129 all modules that were not passed as Extension objects (i.e. only source
130 files and file patterns).
131
3154bef scoder make Py_hash_t a known type
scoder authored
132 * ``Py_hash_t`` is a known type (used in CPython for hash values).
133
ee86071 scoder changelog
scoder authored
134 * ``PySlice_*()`` C-API functions are available from the ``cpython.slice``
135 module.
136
9b1d6e2 scoder changelog
scoder authored
137 * Allow arrays of C++ classes.
138
871377b scoder Fix crash when an exception occurs during module init and the stale modu...
scoder authored
139 Bugs fixed
140 ----------
141
68a5d5d scoder fix a reference leak for non-simple conditions in boolean and/or express...
scoder authored
142 * Reference leak for non-simple Python expressions in boolean and/or expressions.
143
77b4c4b c-blake Change CHANGES.rst to reflect the actual difference from 0.21 release.
c-blake authored
144 * To fix a name collision and to reflect availability on host platforms,
145 standard C declarations [ clock(), time(), struct tm and tm* functions ]
8a1c831 scoder changelog
scoder authored
146 were moved from posix/time.pxd to a new libc/time.pxd. Patch by Charles
147 Blake.
4562c6b scoder extract sys_time.pxd from time.pxd to fix naming collision of "struct ti...
scoder authored
148
ee86071 scoder changelog
scoder authored
149 * Rerunning unmodified modules in IPython's cython support failed.
150 Patch by Matthias Bussonier.
151
152 * Casting C++ ``std::string`` to Python byte strings failed when
153 auto-decoding was enabled.
113bdaa scoder fix explicit <bytes> etc. casts for C++ std::string when auto-decoding i...
scoder authored
154
871377b scoder Fix crash when an exception occurs during module init and the stale modu...
scoder authored
155 * Fatal exceptions in global module init code could lead to crashes
156 if the already created module was used later on (e.g. through a
157 stale reference in sys.modules or elsewhere).
158
862b786 scoder changelog
scoder authored
159 * ``cythonize.py`` script was not installed on MS-Windows.
160
f03bb32 scoder turn cythonize() error on unknown compilation options into a warning
scoder authored
161 Other changes
162 -------------
163
9262e55 scoder changelog
scoder authored
164 * Compilation no longer fails hard when unknown compilation options are
165 passed. Instead, it raises a warning and ignores them (as it did silently
166 before 0.21). This will be changed back to an error in a future release.
01529c0 Robert Bradshaw Allow arrays of C++ classes.
robertwb authored
167
871377b scoder Fix crash when an exception occurs during module init and the stale modu...
scoder authored
168
c67e895 scoder prepare release of 0.21
scoder authored
169 0.21 (2014-09-10)
170 =================
5e08f83 scoder fix repeated list multiplication
scoder authored
171
bda9013 Robert Bradshaw Support for C++ unordered sets and maps.
robertwb authored
172 Features added
173 --------------
174
b8ce0ee scoder changelog
scoder authored
175 * C (cdef) functions allow inner Python functions.
176
50133b5 Robert Bradshaw Allow extern cpdef enum to export values into Python-level namespace.
robertwb authored
177 * Enums can now be declared as cpdef to export their values to
178 the module's Python namespace. Cpdef enums in pxd files export
179 their values to their own module, iff it exists.
180
ee80d4b Robert Bradshaw Static cdef methods.
robertwb authored
181 * Allow @staticmethod decorator to declare static cdef methods.
182 This is especially useful for declaring "constructors" for
183 cdef classes that can take non-Python arguments.
184
37e4a20 scoder generally postpone the cleanup for char* temps to improve safety and mov...
scoder authored
185 * Taking a ``char*`` from a temporary Python string object is safer
186 in more cases and can be done inside of non-trivial expressions,
187 including arguments of a function call. A compile time error
188 is raised only when such a pointer is assigned to a variable and
189 would thus exceed the lifetime of the string itself.
190
0c19e21 scoder add __name__ and __qualname__ properties to generators
scoder authored
191 * Generators have new properties ``__name__`` and ``__qualname__``
192 that provide the plain/qualified name of the generator function
25d180e scoder changelog
scoder authored
193 (following CPython 3.5). See http://bugs.python.org/issue21205
0c19e21 scoder add __name__ and __qualname__ properties to generators
scoder authored
194
fea7ad6 scoder implement "@cython.inline" decorator for functions
scoder authored
195 * The ``inline`` function modifier is available as a decorator
196 ``@cython.inline`` in pure mode.
197
9147301 scoder activate virtualenv inside of cygdb if it was enabled outside
scoder authored
198 * When cygdb is run in a virtualenv, it enables the same virtualenv
199 inside of the debugger. Patch by Marc Abramowitz.
200
369b75e scoder changelog
scoder authored
201 * PEP 465: dedicated infix operator for matrix multiplication (A @ B).
202
0df1efa scoder changelog
scoder authored
203 * HTML output of annotated code uses Pygments for code highlighting
204 and generally received a major overhaul by Matthias Bussonier.
205
a1765d5 scoder changelog
scoder authored
206 * IPython magic support is now available directly from Cython with
207 the command "%load_ext cython". Cython code can directly be
208 executed in a cell when marked with "%%cython". Code analysis
209 is available with "%%cython -a". Patch by Martín Gaitán.
210
c036607 scoder implement support for extracting type declarations from signature annota...
scoder authored
211 * Simple support for declaring Python object types in Python signature
c31b0fa scoder changelog
scoder authored
212 annotations. Currently requires setting the compiler directive
213 ``annotation_typing=True``.
c036607 scoder implement support for extracting type declarations from signature annota...
scoder authored
214
25d180e scoder changelog
scoder authored
215 * New directive ``use_switch`` (defaults to True) to optionally disable
216 the optimization of chained if statement to C switch statements.
a72e23e Robert Bradshaw Document use_switch directive.
robertwb authored
217
42beae3 scoder changelog
scoder authored
218 * Defines dynamic_cast et al. in ``libcpp.cast`` and C++ heap data
219 structure operations in ``libcpp.algorithm``.
b4d4eda Lars add support for C++ stdlib heap operations
larsmans authored
220
05466cb scoder changelog
scoder authored
221 * Shipped header declarations in ``posix.*`` were extended to cover
222 more of the POSIX API. Patches by Lars Buitinck and Mark Peek.
223
394aa9a Robert Bradshaw Merge branch 'master' into static
robertwb authored
224 Optimizations
225 -------------
226
677efaa scoder optimise 1-arg/no-args calls to PyCFunction by avoiding tuple packing if...
scoder authored
227 * Simple calls to C implemented Python functions/methods are faster.
cbd7b2c scoder changelog
scoder authored
228 This also speeds up many operations on builtins that Cython cannot
229 otherwise optimise.
677efaa scoder optimise 1-arg/no-args calls to PyCFunction by avoiding tuple packing if...
scoder authored
230
dd85410 Robert Bradshaw Merge branch 'master' into static
robertwb authored
231 * The "and"/"or" operators try to avoid unnecessary coercions of their
232 arguments. They now evaluate the truth value of each argument
233 independently and only coerce the final result of the whole expression
234 to the target type (e.g. the type on the left side of an assignment).
235 This also avoids reference counting overhead for Python values during
236 evaluation and generally improves the code flow in the generated C code.
237
394aa9a Robert Bradshaw Merge branch 'master' into static
robertwb authored
238 * The Python expression "2 ** N" is optimised into bit shifting.
239 See http://bugs.python.org/issue21420
240
241 * Cascaded assignments (a = b = ...) try to minimise the number of
242 type coercions.
243
244 * Calls to ``slice()`` are translated to a straight C-API call.
245
a3bc5f5 scoder increase version of master branch to 0.21dev
scoder authored
246 Bugs fixed
247 ----------
248
7a47dfd scoder fix crash when assigning memoryviews through ternary conditional express...
scoder authored
249 * Crash when assigning memory views from ternary conditional expressions.
250
43d1490 scoder changelog
scoder authored
251 * Nested C++ templates could lead to unseparated ">>" characters being
252 generated into the C++ declarations, which older C++ compilers could
253 not parse.
254
9e55dee scoder changelog
scoder authored
255 * Sending SIGINT (Ctrl-C) during parallel cythonize() builds could
256 hang the child processes.
257
259d392 scoder changelog
scoder authored
258 * No longer ignore local setup.cfg files for distutils in pyximport.
259 Patch by Martin Teichmann.
260
37e4a20 scoder generally postpone the cleanup for char* temps to improve safety and mov...
scoder authored
261 * Taking a ``char*`` from an indexed Python string generated unsafe
262 reference counting code.
263
3726462 scoder changelog
scoder authored
264 * Set literals now create all of their items before trying to add them
265 to the set, following the behaviour in CPython. This makes a
266 difference in the rare case that the item creation has side effects
267 and some items are not hashable (or if hashing them has side effects,
268 too).
269
90cf645 scoder changelog
scoder authored
270 * Cython no longer generates the cross product of C functions for code
271 that uses memory views of fused types in function signatures (e.g.
272 ``cdef func(floating[:] a, floating[:] b)``). This is considered the
273 expected behaviour by most users and was previously inconsistent with
274 other structured types like C arrays. Code that really wants all type
275 combinations can create the same fused memoryview type under different
276 names and use those in the signature to make it clear which types are
277 independent.
278
781439e scoder changelog
scoder authored
279 * Names that were unknown at compile time were looked up as builtins at
228f30a scoder changelog
scoder authored
280 runtime but not as global module names. Trying both lookups helps with
281 globals() manipulation.
781439e scoder changelog
scoder authored
282
770acb7 Robert Bradshaw Fixed stl container conversion with typedef element types.
robertwb authored
283 * Fixed stl container conversion for typedef element types.
284
f7ee3cb scoder changelog
scoder authored
285 * ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.
286
0df1efa scoder changelog
scoder authored
287 * ``__init__.pyc`` is recognised as marking a package directory
288 (in addition to .py, .pyx and .pxd).
289
bf4d9dc scoder changelog
scoder authored
290 * Syntax highlighting in ``cython-mode.el`` for Emacs no longer
291 incorrectly highlights keywords found as part of longer names.
292
279b7b9 scoder changelog
scoder authored
293 * Correctly handle ``from cython.submodule cimport name``.
ff0b1b1 Robert Bradshaw Correctly handle `from cython.submodule comport name``.
robertwb authored
294
191b923 Robert Bradshaw Fix infinite recurison when using super with cpdef methods.
robertwb authored
295 * Fix infinite recursion when using super with cpdef methods.
296
e87b617 scoder changelog
scoder authored
297 * No-args ``dir()`` was not guaranteed to return a sorted list.
298
a3bc5f5 scoder increase version of master branch to 0.21dev
scoder authored
299 Other changes
300 -------------
301
17ec3f8 scoder changelog
scoder authored
302 * The header line in the generated C files no longer contains the
303 timestamp but only the Cython version that wrote it. This was
304 changed to make builds more reproducible.
305
bf4d9dc scoder changelog
scoder authored
306 * Removed support for CPython 2.4, 2.5 and 3.1.
307
a1765d5 scoder changelog
scoder authored
308 * The licensing implications on the generated code were clarified
309 to avoid legal constraints for users.
310
a3bc5f5 scoder increase version of master branch to 0.21dev
scoder authored
311
192a4c1 Robert Bradshaw Bump version.
robertwb authored
312 0.20.2 (2014-06-16)
a3bc5f5 scoder increase version of master branch to 0.21dev
scoder authored
313 ===================
314
315 Features added
316 --------------
317
1012763 scoder changelog
scoder authored
318 * Some optimisations for set/frozenset instantiation.
bda9013 Robert Bradshaw Support for C++ unordered sets and maps.
robertwb authored
319
1012763 scoder changelog
scoder authored
320 * Support for C++ unordered_set and unordered_map.
bda9013 Robert Bradshaw Support for C++ unordered sets and maps.
robertwb authored
321
52b5142 scoder changelog
scoder authored
322 Bugs fixed
323 ----------
324
135e52d scoder fix access to attributes of optimised builtin methods (e.g. '__name__')
scoder authored
325 * Access to attributes of optimised builtin methods (e.g.
326 ``[].append.__name__``) could fail to compile.
327
68f9263 scoder fix memory leak for memory views in extension subtypes
scoder authored
328 * Memory leak when extension subtypes add a memory view as attribute
329 to those of the parent type without having Python object attributes
330 or a user provided dealloc method.
331
e7ffd0a scoder fix compiler crash on "readonly" properties in "binding" mode
scoder authored
332 * Compiler crash on readonly properties in "binding" mode.
333
73e24e8 scoder fix ascii auto-encoding in Py3.3
scoder authored
334 * Auto-encoding with ``c_string_encoding=ascii`` failed in Py3.3.
335
d2aff82 scoder fix crash by excluding heap types from the extension type freelists
scoder authored
336 * Crash when subtyping freelist enabled Cython extension types with
337 Python classes that use ``__slots__``.
338
895e206 scoder restrict freelist usage to CPython
scoder authored
339 * Freelist usage is restricted to CPython to avoid problems with other
340 Python implementations.
341
956f650 scoder fix memory leak in memory views when copying overlapping contiguous slic...
scoder authored
342 * Memory leak in memory views when copying overlapping, contiguous slices.
343
5f35da2 scoder fix format checking for cython.array.__getbuffer__() in Py3
scoder authored
344 * Format checking when requesting non-contiguous buffers from
7c20a89 scoder changelog
scoder authored
345 ``cython.array`` objects was accidentally omitted in Py3.
5f35da2 scoder fix format checking for cython.array.__getbuffer__() in Py3
scoder authored
346
52b5142 scoder changelog
scoder authored
347 * C++ destructor calls in extension types could fail to compile in clang.
348
58d9361 scoder fix buffer format validation for sequences of strings in structs
scoder authored
349 * Buffer format validation failed for sequences of strings in structs.
350
52b5142 scoder changelog
scoder authored
351 * Docstrings on extension type attributes in .pxd files were rejected.
352
bda9013 Robert Bradshaw Support for C++ unordered sets and maps.
robertwb authored
353
c7c0180 Robert Bradshaw Bump version for release.
robertwb authored
354 0.20.1 (2014-02-11)
355 ===================
5e08f83 scoder fix repeated list multiplication
scoder authored
356
357 Bugs fixed
358 ----------
359
173d08e scoder changelog
scoder authored
360 * Build error under recent MacOS-X versions where ``isspace()`` could not be
361 resolved by clang.
362
5e08f83 scoder fix repeated list multiplication
scoder authored
363 * List/Tuple literals multiplied by more than one factor were only multiplied
364 by the last factor instead of all.
365
b8e37bc scoder disable usage of _PyType_Lookup() in Py<=2.6/3.1
scoder authored
366 * Lookups of special methods (specifically for context managers) could fail
367 in Python <= 2.6/3.1.
368
1e71f4e scoder fix signature introspection for functions with kwonly arguments
scoder authored
369 * Local variables were erroneously appended to the signature introspection
ed41403 scoder changelog
scoder authored
370 of Cython implemented functions with keyword-only arguments under Python 3.
1e71f4e scoder fix signature introspection for functions with kwonly arguments
scoder authored
371
5e08f83 scoder fix repeated list multiplication
scoder authored
372 * In-place assignments to variables with inferred Python builtin/extension
373 types could fail with type errors if the result value type was incompatible
374 with the type of the previous value.
375
376 * The C code generation order of cdef classes, closures, helper code,
377 etc. was not deterministic, thus leading to high code churn.
378
379 * Type inference could fail to deduce C enum types.
380
381 * Type inference could deduce unsafe or inefficient types from integer
382 assignments within a mix of inferred Python variables and integer
383 variables.
384
385
061ca11 Robert Bradshaw Add date to release notes.
robertwb authored
386
387 0.20 (2014-01-18)
388 =================
d0e6b3d scoder changelog
scoder authored
389
390 Features added
391 --------------
392
48975c9 scoder changelog
scoder authored
393 * Support for CPython 3.4.
394
9016bdb Robert Bradshaw Release notes.
robertwb authored
395 * Support for calling C++ template functions.
396
a1238e2 scoder implement 'yield' inside of 'finally' clause
scoder authored
397 * ``yield`` is supported in ``finally`` clauses.
398
9729f16 scoder changelog
scoder authored
399 * The C code generated for finally blocks is duplicated for each exit
f2f7d37 scoder fix typo
scoder authored
400 case to allow for better optimisations by the C compiler.
9729f16 scoder changelog
scoder authored
401
402 * Cython tries to undo the Python optimisationism of assigning a bound
403 method to a local variable when it can generate better code for the
404 direct call.
405
92e16f1 scoder changelog
scoder authored
406 * Constant Python float values are cached.
407
f25b99d scoder changelog
scoder authored
408 * String equality comparisons can use faster type specific code in
409 more cases than before.
410
c66eca2 scoder changelog
scoder authored
411 * String/Unicode formatting using the '%' operator uses a faster
412 C-API call.
413
6900b53 scoder support 'bytearray' in the same way as 'bytes', starting with Py2.6
scoder authored
414 * ``bytearray`` has become a known type and supports coercion from and
8524b21 scoder support bytearray as auto encoding string type
scoder authored
415 to C strings. Indexing, slicing and decoding is optimised. Note that
416 this may have an impact on existing code due to type inference.
6900b53 scoder support 'bytearray' in the same way as 'bytes', starting with Py2.6
scoder authored
417
f8233ea scoder extend semantics of 'basestring' typed variables to represent exactly by...
scoder authored
418 * Using ``cdef basestring stringvar`` and function arguments typed as
419 ``basestring`` is now meaningful and allows assigning exactly
c9ff29a scoder changelog
scoder authored
420 ``str`` and ``unicode`` objects, but no subtypes of these types.
f8233ea scoder extend semantics of 'basestring' typed variables to represent exactly by...
scoder authored
421
35fa56a scoder changelog
scoder authored
422 * Support for the ``__debug__`` builtin.
423
424 * Assertions in Cython compiled modules are disabled if the running
425 Python interpreter was started with the "-O" option.
426
939c44e scoder changelog
scoder authored
427 * Some types that Cython provides internally, such as functions and
428 generators, are now shared across modules if more than one Cython
429 implemented module is imported.
430
431 * The type inference algorithm works more fine granular by taking the
432 results of the control flow analysis into account.
433
4f119a8 scoder add bin/cythonize script
scoder authored
434 * A new script in ``bin/cythonize`` provides a command line frontend
435 to the cythonize() compilation function (including distutils build).
436
d32cdad scoder changelog
scoder authored
437 * The new extension type decorator ``@cython.no_gc_clear`` prevents
16c9b6b scoder minor changelog fix
scoder authored
438 objects from being cleared during cyclic garbage collection, thus
d32cdad scoder changelog
scoder authored
439 making sure that object attributes are kept alive until deallocation.
440
3c878c6 scoder changelog
scoder authored
441 * During cyclic garbage collection, attributes of extension types that
fc0a514 scoder changelog
scoder authored
442 cannot create reference cycles due to their type (e.g. strings) are
b07d9d7 scoder changelog
scoder authored
443 no longer considered for traversal or clearing. This can reduce the
444 processing overhead when searching for or cleaning up reference cycles.
3c878c6 scoder changelog
scoder authored
445
5c6c97b scoder always set __path__ for compiled packages and in Py3.3 actually implemen...
scoder authored
446 * Package compilation (i.e. ``__init__.py`` files) now works, starting
447 with Python 3.3.
448
8a51c8a scoder changelog
scoder authored
449 * The cython-mode.el script for Emacs was updated. Patch by Ivan Andrus.
43158a5 scoder changelog
scoder authored
450
367498f Robert Bradshaw Explicitly disallow caching + common_utility_include_dir.
robertwb authored
451 * An option common_utility_include_dir was added to cythonize() to save
452 oft-used utility code once in a separate directory rather than as
453 part of each generated file.
454
e0ef44b Robert Bradshaw Unraisable traceback docs.
robertwb authored
455 * ``unraisable_tracebacks`` directive added to control printing of
456 tracebacks of unraisable exceptions.
457
d0e6b3d scoder changelog
scoder authored
458 Bugs fixed
459 ----------
460
85f5c24 scoder changelog
scoder authored
461 * Abstract Python classes that subtyped a Cython extension type
462 failed to raise an exception on instantiation, and thus ended
463 up being instantiated.
464
0d1df63 scoder changelog
scoder authored
465 * ``set.add(a_tuple)`` and ``set.discard(a_tuple)`` failed with a
466 TypeError in Py2.4.
467
f082a44 scoder reimplement PEP 3155 __qualname__ calculation in a dedicated transform t...
scoder authored
468 * The PEP 3155 ``__qualname__`` was incorrect for nested classes and
469 inner classes/functions declared as ``global``.
470
1955a53 scoder implement another try-finally corner case (the Py3 way only for now!): r...
scoder authored
471 * Several corner cases in the try-finally statement were fixed.
472
c0c8f92 scoder implement metaclass calculation/validation algorithm, make classes inher...
scoder authored
473 * The metaclass of a Python class was not inherited from its parent
474 class(es). It is now extracted from the list of base classes if not
475 provided explicitly using the Py3 ``metaclass`` keyword argument.
476 In Py2 compilation mode, a ``__metaclass__`` entry in the class
477 dict will still take precedence if not using Py3 metaclass syntax,
478 but only *after* creating the class dict (which may have been done
479 by a metaclass of a base class, see PEP 3115). It is generally
480 recommended to use the explicit Py3 syntax to define metaclasses
481 for Python types at compile time.
482
d0e6b3d scoder changelog
scoder authored
483 * The automatic C switch statement generation behaves more safely for
484 heterogeneous value types (e.g. mixing enum and char), allowing for
485 a slightly wider application and reducing corner cases. It now always
486 generates a 'default' clause to avoid C compiler warnings about
487 unmatched enum values.
488
e1f4acc Robert Bradshaw Release notes.
robertwb authored
489 * Fixed a bug where class hierarchies declared out-of-order could result
490 in broken generated code.
491
9016bdb Robert Bradshaw Release notes.
robertwb authored
492 * Fixed a bug which prevented overriding const methods of C++ classes.
493
d929ac0 scoder fix crash in Python object to C++ string conversion
scoder authored
494 * Fixed a crash when converting Python objects to C++ strings fails.
495
d0e6b3d scoder changelog
scoder authored
496 Other changes
497 -------------
498
c0c8f92 scoder implement metaclass calculation/validation algorithm, make classes inher...
scoder authored
499 * In Py3 compilation mode, Python2-style metaclasses declared by a
500 ``__metaclass__`` class dict entry are ignored.
501
b07d9d7 scoder changelog
scoder authored
502 * In Py3.4+, the Cython generator type uses ``tp_finalize()`` for safer
503 cleanup instead of ``tp_del()``.
1ec7490 scoder changelog
scoder authored
504
d0e6b3d scoder changelog
scoder authored
505
c2ddf29 scoder prepare release of 0.19.2
scoder authored
506 0.19.2 (2013-10-13)
7826127 scoder changelog
scoder authored
507 ===================
508
509 Features added
510 --------------
511
512 Bugs fixed
513 ----------
514
23fa0ea scoder changelog
scoder authored
515 * Some standard declarations were fixed or updated, including the previously
516 incorrect declaration of ``PyBuffer_FillInfo()`` and some missing bits in
517 ``libc.math``.
518
519 * Heap allocated subtypes of ``type`` used the wrong base type struct at the
520 C level.
521
7826127 scoder changelog
scoder authored
522 * Calling the unbound method dict.keys/value/items() in dict subtypes could
523 call the bound object method instead of the unbound supertype method.
524
e3ef526 scoder changelog
scoder authored
525 * "yield" wasn't supported in "return" value expressions.
526
527 * Using the "bint" type in memory views lead to unexpected results.
528 It is now an error.
529
530 * Assignments to global/closure variables could catch them in an illegal state
531 while deallocating the old value.
7826127 scoder changelog
scoder authored
532
533 Other changes
534 -------------
535
536
8f07f8d scoder fix release date
scoder authored
537 0.19.1 (2013-05-11)
5045a86 scoder changelog
scoder authored
538 ===================
539
540 Features added
541 --------------
542
be0303a scoder changelog
scoder authored
543 * Completely empty C-API structs for extension type slots (protocols like
573ab07 scoder remove credits, as requested
scoder authored
544 number/mapping/sequence) are no longer generated into the C code.
be0303a scoder changelog
scoder authored
545
439f97c scoder changelog
scoder authored
546 * Docstrings that directly follow a public/readonly attribute declaration
547 in a cdef class will be used as docstring of the auto-generated property.
573ab07 scoder remove credits, as requested
scoder authored
548 This fixes ticket 206.
439f97c scoder changelog
scoder authored
549
550 * The automatic signature documentation tries to preserve more semantics
551 of default arguments and argument types. Specifically, ``bint`` arguments
573ab07 scoder remove credits, as requested
scoder authored
552 now appear as type ``bool``.
439f97c scoder changelog
scoder authored
553
5045a86 scoder changelog
scoder authored
554 * A warning is emitted when negative literal indices are found inside of
555 a code section that disables ``wraparound`` handling. This helps with
556 fixing invalid code that might fail in the face of future compiler
557 optimisations.
558
559 * Constant folding for boolean expressions (and/or) was improved.
560
9124416 Robert Bradshaw Update release notes.
robertwb authored
561 * Added a build_dir option to cythonize() which allows one to place
562 the generated .c files outside the source tree.
563
5045a86 scoder changelog
scoder authored
564 Bugs fixed
565 ----------
566
4dde32b scoder changelog
scoder authored
567 * ``isinstance(X, type)`` failed to get optimised into a call to
568 ``PyType_Check()``, as done for other builtin types.
569
c500e85 scoder remove 'from datetime cimport *' line from cpython/__init__.pxd as it re...
scoder authored
570 * A spurious "from datetime cimport *" was removed from the "cpython"
571 declaration package. This means that the "datetime" declarations
572 (added in 0.19) are no longer available directly from the "cpython"
573 namespace, but only from "cpython.datetime". This is the correct
574 way of doing it because the declarations refer to a standard library
575 module, not the core CPython C-API itself.
576
1491df8 scoder changelog
scoder authored
577 * The C code for extension types is now generated in topological order
578 instead of source code order to avoid C compiler errors about missing
579 declarations for subtypes that are defined before their parent.
580
3078752 scoder changelog
scoder authored
581 * The ``memoryview`` type name no longer shows up in the module dict of
582 modules that use memory views. This fixes trac ticket 775.
583
b87e6f8 scoder changelog
scoder authored
584 * Regression in 0.19 that rejected valid C expressions from being used
585 in C array size declarations.
586
5045a86 scoder changelog
scoder authored
587 * In C++ mode, the C99-only keyword ``restrict`` could accidentally be
588 seen by the GNU C++ compiler. It is now specially handled for both
589 GCC and MSVC.
590
591 * Testing large (> int) C integer values for their truth value could fail
592 due to integer wrap-around.
593
594 Other changes
595 -------------
596
597
928d638 scoder prepare release of 0.19
scoder authored
598 0.19 (2013-04-19)
a62cbf3 scoder changelog
scoder authored
599 =================
600
601 Features added
602 --------------
603
6ce7dbd scoder changelog
scoder authored
604 * New directives ``c_string_type`` and ``c_string_encoding`` to more easily
605 and automatically convert between C strings and the different Python string
606 types.
607
b1f10fa scoder enable Py_TPFLAGS_HAVE_VERSION_TAG on extension types by default (also i...
scoder authored
608 * The extension type flag ``Py_TPFLAGS_HAVE_VERSION_TAG`` is enabled by default
609 on extension types and can be disabled using the ``type_version_tag`` compiler
610 directive.
611
e2a07e8 scoder implement experimental support for line tracing
scoder authored
612 * EXPERIMENTAL support for simple Cython code level line tracing. Enabled by
613 the "linetrace" compiler directive.
614
717df79 scoder implement __annotations__ attribute on CyFunction (PEP 3107)
scoder authored
615 * Cython implemented functions make their argument and return type annotations
616 available through the ``__annotations__`` attribute (PEP 3107).
617
fca7932 scoder changelog
scoder authored
618 * Access to non-cdef module globals and Python object attributes is faster.
619
620 * ``Py_UNICODE*`` coerces from and to Python unicode strings. This is
621 helpful when talking to Windows APIs, which use compatible wchar_t
622 arrays for strings. Note that the ``Py_UNICODE`` type is otherwise
623 deprecated as of CPython 3.3.
624
2473582 scoder optimise isinstance(obj, basestring) and map basestring to unicode in Py...
scoder authored
625 * ``isinstance(obj, basestring)`` is optimised. In Python 3 it only tests
626 for instances of ``str`` (i.e. Py2 ``unicode``).
627
628 * The ``basestring`` builtin is mapped to ``str`` (i.e. Py2 ``unicode``) when
629 compiling the generated C code under Python 3.
630
e8bd178 scoder changelog
scoder authored
631 * Closures use freelists, which can speed up their creation quite substantially.
632 This is also visible for short running generator expressions, for example.
633
7f524da scoder changelog
scoder authored
634 * A new class decorator ``@cython.freelist(N)`` creates a static freelist of N
635 instances for an extension type, thus avoiding the costly allocation step if
636 possible. This can speed up object instantiation by 20-30% in suitable
0322f85 scoder changelog
scoder authored
637 scenarios. Note that freelists are currently only supported for base types,
638 not for types that inherit from others.
7f524da scoder changelog
scoder authored
639
2289101 scoder changelog
scoder authored
640 * Fast extension type instantiation using the ``Type.__new__(Type)`` idiom has
641 gained support for passing arguments. It is also a bit faster for types defined
642 inside of the module.
643
6a02869 scoder automatically convert dict.iter*() and dict.view*() methods to .keys/val...
scoder authored
644 * The Python2-only dict methods ``.iter*()`` and ``.view*()`` (requires Python 2.7)
645 are automatically mapped to the equivalent keys/values/items methods in Python 3
646 for typed dictionaries.
647
d2ac07b scoder changelog
scoder authored
648 * Slicing unicode strings, lists and tuples is faster.
f0df11b scoder changelog
scoder authored
649
bddb52a scoder changelog
scoder authored
650 * list.append() is faster on average.
651
27b20d1 scoder changelog
scoder authored
652 * ``raise Exception() from None`` suppresses the exception context in Py3.3.
653
862249f scoder changelog
scoder authored
654 * Py3 compatible ``exec(tuple)`` syntax is supported in Py2 code.
655
a62cbf3 scoder changelog
scoder authored
656 * Keyword arguments are supported for cdef functions.
657
6ce7dbd scoder changelog
scoder authored
658 * External C++ classes can be declared nogil. Patch by John Stumpo. This fixes
659 trac ticket 805.
0ec2ff4 Robert Bradshaw Docs for c_string_type and c_string_encoding
robertwb authored
660
a62cbf3 scoder changelog
scoder authored
661 Bugs fixed
662 ----------
663
0105dd2 scoder changelog
scoder authored
664 * 2-value slicing of unknown objects passes the correct slice when the ``getitem``
665 protocol is used instead of the ``getslice`` protocol (especially in Python 3),
666 i.e. ``None`` values for missing bounds instead of ``[0,maxsize]``. It is also
667 a bit faster in some cases, e.g. for constant bounds. This fixes trac ticket 636.
668
b108bdb scoder changelog
scoder authored
669 * Cascaded assignments of None values to extension type variables failed with
670 a ``TypeError`` at runtime.
671
ea569ef scoder implement __kwdefaults__ for CyFunction
scoder authored
672 * The ``__defaults__`` attribute was not writable for Cython implemented
673 functions.
674
675 * Default values of keyword-only arguments showed up in ``__defaults__`` instead
676 of ``__kwdefaults__`` (which was not implemented). Both are available for
677 Cython implemented functions now, as specified in Python 3.x.
678
187e8c5 scoder changelog
scoder authored
679 * ``yield`` works inside of ``with gil`` sections. It previously lead to a crash.
680 This fixes trac ticket 803.
681
682 * Static methods without explicitly named positional arguments (e.g. having only
683 ``*args``) crashed when being called. This fixes trac ticket 804.
684
ea881aa scoder changelog
scoder authored
685 * ``dir()`` without arguments previously returned an unsorted list, which now
686 gets sorted as expected.
687
8010815 scoder changelog
scoder authored
688 * ``dict.items()``, ``dict.keys()`` and ``dict.values()`` no longer return lists
689 in Python 3.
690
862249f scoder changelog
scoder authored
691 * Exiting from an ``except-as`` clause now deletes the exception in Python 3 mode.
692
a62cbf3 scoder changelog
scoder authored
693 * The declarations of ``frexp()`` and ``ldexp()`` in ``math.pxd`` were incorrect.
694
695 Other changes
696 -------------
697
698
afbd83a scoder prepare release of 0.18
scoder authored
699 0.18 (2013-01-28)
700 =================
a0778c1 scoder added 0.18 section to changelog
scoder authored
701
702 Features added
703 --------------
704
2a9d8d4 scoder implement \N{...} Unicode escapes for literals
scoder authored
705 * Named Unicode escapes ("\N{...}") are supported.
706
7a91570 scoder implement __qualname__ special attribute on Python functions/classes (PE...
scoder authored
707 * Python functions/classes provide the special attribute "__qualname__"
708 as defined by PEP 3155.
709
cc788b9 Robert Bradshaw More overflowcheck documentation.
robertwb authored
710 * Added a directive ``overflowcheck`` which raises an OverflowException when
711 arithmetic with C ints overflow. This has a modest performance penalty, but
712 is much faster than using Python ints.
713
8b3c9a3 scoder changelog
scoder authored
714 * Calls to nested Python functions are resolved at compile time.
715
716 * Type inference works across nested functions.
717
1a58859 scoder optimise bytes.decode()
scoder authored
718 * ``py_bytes_string.decode(...)`` is optimised.
719
939f8f8 scoder changelog
scoder authored
720 * C ``const`` declarations are supported in the language.
721
a0778c1 scoder added 0.18 section to changelog
scoder authored
722 Bugs fixed
723 ----------
724
3eedf16 scoder changelog
scoder authored
725 * Automatic C++ exception mapping didn't work in nogil functions (only in
726 "with nogil" blocks).
727
a0778c1 scoder added 0.18 section to changelog
scoder authored
728 Other changes
729 -------------
730
731
53db1cd Robert Bradshaw Prep for 0.17.4 release.
robertwb authored
732 0.17.4 (2013-01-03)
733 ===================
734
735 Bugs fixed
736 ----------
737
738 * Garbage collection triggered during deallocation of container classes could lead to a double-deallocation.
739
740
1da2e2f scoder prepare release of 0.17.3
scoder authored
741 0.17.3 (2012-12-14)
4e3445d scoder changelog
scoder authored
742 ===================
743
744 Features added
745 --------------
746
747 Bugs fixed
748 ----------
749
8541d7b scoder fix crash bug during final cleanup for cimported base types
scoder authored
750 * 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.
751
1dc512a scoder changelog
scoder authored
752 * Weak-reference support in extension types (with a ``cdef __weakref__`` attribute) generated incorrect deallocation code.
753
19c2e5a scoder changelog fix
scoder authored
754 * 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.
755
4e3445d scoder changelog
scoder authored
756 * Negative C integer constants lost their longness suffix in the generated C code.
757
758 Other changes
759 -------------
760
761
10183d6 scoder prepare release of 0.17.2
scoder authored
762 0.17.2 (2012-11-20)
977c15c scoder added changelog file
scoder authored
763 ===================
764
765 Features added
766 --------------
767
768 * ``cythonize()`` gained a best effort compile mode that can be used to simply ignore .py files that fail to compile.
769
770 Bugs fixed
771 ----------
772
10183d6 scoder prepare release of 0.17.2
scoder authored
773 * 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.
774
f2ef0f5 scoder changelog
scoder authored
775 * C-to-Python type coercions during cascaded comparisons could generate invalid C code, specifically when using the 'in' operator.
776
24cdbff scoder make the parser correctly understand obj[1,] as passing a tuple as key
scoder authored
777 * "obj[1,]" passed a single integer into the item getter instead of a tuple.
778
977c15c scoder added changelog file
scoder authored
779 * Cyclic imports at module init time did not work in Py3.
780
781 * The names of C++ destructors for template classes were built incorrectly.
782
783 * In pure mode, type casts in Cython syntax and the C ampersand operator are now rejected. Use the pure mode replacements instead.
784
785 * In pure mode, C type names and the sizeof() function are no longer recognised as such and can be used as normal Python names.
786
787 * The extended C level support for the CPython array type was declared too late to be used by user defined classes.
788
789 * C++ class nesting was broken.
790
402dc50 Robert Bradshaw Fix compiler crash for invalid C++ base classes.
robertwb authored
791 * Better checking for required nullary constructors for stack-allocated C++ instances.
792
793 * Remove module docstring in no-docstring mode.
794
795 * Fix specialization for varargs function signatures.
796
797 * Fix several compiler crashes.
798
977c15c scoder added changelog file
scoder authored
799 Other changes
800 -------------
801
4de2055 scoder changelog comment
scoder authored
802 * An experimental distutils script for compiling the CPython standard library was added as Tools/cystdlib.py.
803
977c15c scoder added changelog file
scoder authored
804
805 0.17.1 (2012-09-26)
806 ===================
807
808 Features added
809 --------------
810
811 Bugs fixed
812 ----------
813
814 * A reference leak was fixed in the new dict iteration code when the loop target was not a plain variable but an unpacked tuple.
815
816 * Memory views did not handle the special case of a NULL buffer strides value, as allowed by PEP3118.
817
818 Other changes
819 -------------
820
821
822 0.17 (2012-09-01)
823 =================
824
825 Features added
826 --------------
827
31215ed scoder minor changelog cleanups
scoder authored
828 * 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.
977c15c scoder added changelog file
scoder authored
829
830 * "yield from" is supported (PEP 380) and a couple of minor problems with generators were fixed.
831
31215ed scoder minor changelog cleanups
scoder authored
832 * 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.
977c15c scoder added changelog file
scoder authored
833
31215ed scoder minor changelog cleanups
scoder authored
834 * 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)).
977c15c scoder added changelog file
scoder authored
835
836 * cdef classes can now have C++ class members (provided a zero-argument constructor exists)
837
838 * 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.
839
840 * Fast dict iteration is now enabled optimistically also for untyped variables when the common iteration methods are used.
841
842 * The unicode string processing code was adapted for the upcoming CPython 3.3 (PEP 393, new Unicode buffer layout).
843
844 * Buffer arguments and memory view arguments in Python functions can be declared "not None" to raise a TypeError on None input.
845
846 * c(p)def functions in pure mode can specify their return type with "@cython.returns()".
847
848 * Automatic dispatch for fused functions with memoryview arguments
849
850 * Support newaxis indexing for memoryviews
851
852 * Support decorators for fused functions
853
854 Bugs fixed
855 ----------
856
857 * 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).
858
31215ed scoder minor changelog cleanups
scoder authored
859 * 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.
977c15c scoder added changelog file
scoder authored
860
861 * 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.
862
863 * locals() properly ignores names that do not have Python compatible types (including automatically inferred types).
864
865 * Some garbage collection issues of memory views were fixed.
866
867 * numpy.pxd compiles in Python 3 mode.
868
869 * Several C compiler warnings were fixed.
870
871 * Several bugs related to memoryviews and fused types were fixed.
872
873 * Several bug-fixes and improvements related to cythonize(), including ccache-style caching.
874
875 Other changes
876 -------------
877
878 * libc.string provides a convenience declaration for const uchar in addition to const char.
879
880 * User declared char* types are now recognised as such and auto-coerce to and from Python bytes strings.
881
882 * callable() and next() compile to more efficient C code.
883
884 * list.append() is faster on average.
885
886 * Modules generated by @cython.inline() are written into the directory pointed to by the environment variable CYTHON_CACHE_DIR if set.
887
888
889 0.16 (2012-04-21)
890 =================
891
892 Features added
893 --------------
894
895 * Enhancements to Cython's function type (support for weak references, default arguments, code objects, dynamic attributes, classmethods, staticmethods, and more)
896
897 * Fused Types - Template-like support for functions and methods CEP 522 (docs)
898
899 * Typed views on memory - Support for efficient direct and indirect buffers (indexing, slicing, transposing, ...) CEP 517 (docs)
900
901 * super() without arguments
902
903 * Final cdef methods (which translate into direct calls on known instances)
904
905 Bugs fixed
906 ----------
907
908 * fix alignment handling for record types in buffer support
909
910 Other changes
911 -------------
912
913 * support default arguments for closures
914
915 * search sys.path for pxd files
916
917 * support C++ template casting
918
919 * faster traceback building and faster generator termination
920
921 * support inplace operators on indexed buffers
922
923 * allow nested prange sections
924
925
926 0.15.1 (2011-09-19)
927 ===================
928
929 Features added
930 --------------
931
932 Bugs fixed
933 ----------
934
935 Other changes
936 -------------
937
938
939 0.15 (2011-08-05)
940 =================
941
942 Features added
943 --------------
944
945 * Generators (yield) - Cython has full support for generators, generator expressions and PEP 342 coroutines.
946
947 * The nonlocal keyword is supported.
948
949 * Re-acquiring the gil: with gil - works as expected within a nogil context.
950
951 * OpenMP support: prange.
952
953 * Control flow analysis prunes dead code and emits warnings and errors about uninitialised variables.
954
955 * Debugger command cy set to assign values of expressions to Cython variables and cy exec counterpart $cy_eval().
956
957 * Exception chaining PEP 3134.
958
959 * Relative imports PEP 328.
960
961 * Improved pure syntax including cython.cclass, cython.cfunc, and cython.ccall.
962
963 * The with statement has its own dedicated and faster C implementation.
964
965 * Support for del.
966
967 * Boundschecking directives implemented for builtin Python sequence types.
968
969 * Several updates and additions to the shipped standard library .pxd files.
970
971 * Forward declaration of types is no longer required for circular references.
972
973 Bugs fixed
974 ----------
975
976 Other changes
977 -------------
978
979 * Uninitialized variables are no longer initialized to None and accessing them has the same semantics as standard Python.
980
981 * 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
982
983 * 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.
984
985 * 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.
986
987
988 0.14.1 (2011-02-04)
989 ===================
990
991 Features added
992 --------------
993
994 * The gdb debugging support was extended to include all major Cython features, including closures.
995
996 * raise MemoryError() is now safe to use as Cython replaces it with the correct C-API call.
997
998 Bugs fixed
999 ----------
1000
1001 Other changes
1002 -------------
1003
1004 * Decorators on special methods of cdef classes now raise a compile time error rather than being ignored.
1005
1006 * 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.
1007
1008
1009 0.14 (2010-12-14)
1010 =================
1011
1012 Features added
1013 --------------
1014
1015 * Python classes can now be nested and receive a proper closure at definition time.
1016
1017 * Redefinition is supported for Python functions, even within the same scope.
1018
1019 * Lambda expressions are supported in class bodies and at the module level.
1020
1021 * 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.
1022
1023 * "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.
1024
1025 * "internal" extension classes do not show up in the module dictionary. This feature is available through the new "cython.internal" decorator.
1026
1027 * 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).
1028
1029 * GDB support. http://docs.cython.org/src/userguide/debugging.html
1030
1031 * A new build system with support for inline distutils directives, correct dependency tracking, and parallel compilation. http://wiki.cython.org/enhancements/distutils_preprocessing
1032
1033 * Support for dynamic compilation at runtime via the new cython.inline function and cython.compile decorator. http://wiki.cython.org/enhancements/inline
1034
1035 * "nogil" blocks are supported when compiling pure Python code by writing "with cython.nogil".
1036
1037 * Iterating over arbitrary pointer types is now supported, as is an optimized version of the in operator, e.g. x in ptr[a:b].
1038
1039 Bugs fixed
1040 ----------
1041
1042 * 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).
1043
1044 * In some cases, methods of builtin types would raise a SystemError instead of an AttributeError when called on None.
1045
1046 Other changes
1047 -------------
1048
1049 * 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.
1050
1051 * 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.
1052
1053 * 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.
1054
1055 * 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.
1056
1057 * Inplace arithmetic operators now respect the cdivision directive and are supported for complex types.
1058
1059 * 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.
1060
1061 * 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.
1062
1063 * 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.
1064
1065
1066 0.13 (2010-08-25)
1067 =================
1068
1069 Features added
1070 --------------
1071
1072 * Closures are fully supported for Python functions. Cython supports inner functions and lambda expressions. Generators and generator expressions are not supported in this release.
1073
1074 * 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.
1075
1076 * 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.
1077
1078 * 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.
1079
1080 * 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.
1081
1082 * 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.
1083
1084 * 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.
1085
1086 * 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.
1087
1088 * 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.
1089
1090 * 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.
1091
1092 * 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.
1093
1094 * 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.
1095
1096 * print >> stream
1097
1098 Bugs fixed
1099 ----------
1100
1101 Other changes
1102 -------------
1103
1104 * The availability of type inference by default means that Cython will also infer the type of pointers on assignments. Previously, code like this::
1105
1106 cdef char* s = ...
1107 untyped_variable = s
1108
1109 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.
1110
1111 ::
1112
1113 cdef char* s = ...
1114 untyped_variable1 = <bytes>s
1115 untyped_variable2 = <object>s
1116
1117 cdef object py_object = s
1118 cdef bytes bytes_string = s
1119
1120 * 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).
1121
1122 * ``__getsegcount__`` is now correctly typed to take a ``Py_size_t*`` rather than an ``int*``.
1123
1124
1125 0.12.1 (2010-02-02)
1126 ===================
1127
1128 Features added
1129 --------------
1130
1131 * Type inference improvements.
1132
1133 * There have been several bug fixes and improvements to the type inferencer.
1134
1135 * 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.
1136
1137 * The boundscheck directive works for lists and tuples as well as buffers.
1138
1139 * len(s) and s.decode("encoding") are efficiently supported for char* s.
1140
1141 * 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.
1142
1143 * 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.
1144
1145 * 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.
1146
1147 Bugs fixed
1148 ----------
1149
1150 * Several other bugs and minor improvements have been made. This release should be fully backwards compatible with 0.12.
1151
1152 Other changes
1153 -------------
1154
1155
1156 0.12 (2009-11-23)
1157 =================
1158
1159 Features added
1160 --------------
1161
1162 * Type inference with the infer_types directive
1163
1164 * Seamless C++ complex support
1165
1166 * Fast extension type instantiation using the normal Python meme obj = MyType.__new__(MyType)
1167
1168 * Improved support for Py3.1
1169
1170 * Cython now runs under Python 3.x using the 2to3 tool
1171
1172 * unittest support for doctests in Cython modules
1173
1174 * Optimised handling of C strings (char*): for c in cstring[2:50] and cstring.decode()
1175
1176 * Looping over c pointers: for i in intptr[:50].
1177
1178 * pyximport improvements
1179
1180 * cython_freeze improvements
1181
1182 Bugs fixed
1183 ----------
1184
1185 * Many bug fixes
1186
1187 Other changes
1188 -------------
1189
1190 * Many other optimisation, e.g. enumerate() loops, parallel swap assignments (a,b = b,a), and unicode.encode()
1191
1192 * More complete numpy.pxd
1193
1194
1195 0.11.2 (2009-05-20)
1196 ===================
1197
1198 Features added
1199 --------------
1200
1201 * 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]
1202
1203 ::
1204
1205 cdef double complex a = 1 + 0.3j
1206 cdef np.ndarray[np.complex128_t, ndim=2] arr = \
1207 np.zeros(10, np.complex128)
1208
1209 * Cython can now generate a main()-method for embedding of the Python interpreter into an executable (see #289) [Robert Bradshaw]
1210
1211 * @wraparound directive (another way to disable arr[idx] for negative idx) [Dag Sverre Seljebotn]
1212
1213 * Correct support for NumPy record dtypes with different alignments, and "cdef packed struct" support [Dag Sverre Seljebotn]
1214
1215 * @callspec directive, allowing custom calling convention macros [Lisandro Dalcin]
1216
1217 Bugs fixed
1218 ----------
1219
1220 Other changes
1221 -------------
1222
1223 * Bug fixes and smaller improvements. For the full list, see [1].
Something went wrong with that request. Please try again.