Cython has moved to github.

pyrex

view CHANGES.txt @ 104:955ec491fcfc

Fix hex compile-time constants
author Gregory Ewing <greg.ewing@canterbury.ac.nz>
date Wed Aug 27 19:05:46 2008 +1200 (3 years ago)
parents 50dbbb4bc015
children ddbb7a541b77
line source
1 0.9.8.5
2 -------
4 Bug fixes:
6 - Function export code was erroneously generated for 'extern' functions
7 declared in a .pxd file. [Sebastian Sable]
9 - The 'api' option was not recognised with 'ctypedef public class'.
10 [Lisandro Dalcin]
12 - MACOSX_DEPLOYMENT_TARGET is no longer set unless the undocumented -X
13 option is being used. Hopefully this will prevent complaints about it
14 from distutils. [Martin Field]
16 - Recognize MS_WINDOWS as well as WIN32. [Alexander Belchenko]
18 - Hexadecimal compile-time constants did not work. [Devan]
20 Enhancements:
22 - Dependency files (.dep) are only created when compiling with timestamp
23 checking or recursion enabled.
25 Deprecations:
27 - The features introducted in 0.9.8 and 0.9.8.1 for cross-forward-declaring
28 extension types between .pxd files turn out to be unnecessary, since
29 the circular import problems they are aimed at can be avoided using
30 ordinary forward delcarations in the .pxd files ahead of any cimports.
33 0.9.8.4
34 -------
36 Bug fixes:
38 - Incorrect code generated for Python indexing with an unsigned int.
39 [Christopher Williams]
42 0.9.8.3
43 -------
45 Bug fixes:
47 - Compiling multiple source files at once should work as advertised
48 now.
50 - Assignment of a nogil function to a non-nogil function pointer
51 is now allowed.
53 - Applying += or -= to a pointer and an integer did not work.
54 [Arc Riley]
56 - Compiling a .pyx file whose name is not a valid module name now
57 reports an error instead of generating invalid C code.
58 [Robert Bradshaw]
60 - Integer indexing optimisation now performed only for signed
61 index types, to avoid change of semantics with index values
62 greater than the maximum positive signed int value. [Robert
63 Bradshaw]
65 - Non-void function declared 'except *' could produce C compiler
66 warning about uninitialised variable. [Lisandro Dalcin]
69 0.9.8.2
70 -------
72 Enhancements:
74 - A block of external functions can be declared nogil at once.
76 cdef extern from "somewhere.h" nogil:
77 ...
79 Bug fixes:
81 - The nogil attribute was not being checked for a match when
82 comparing function signatures.
84 - Improved error message for C method signature mismatch between
85 a class and its base class.
87 Bug workarounds:
89 - Multiple source files passed to Main.compile are being compiled
90 in separate contexts for the time being until I can sort out a
91 problem. You probably won't notice any difference except that
92 there will be no speed advantage over compiling them separately.
95 0.9.8.1
96 -------
98 Enhancements:
100 - It is no longer necessary to specify the base class of an
101 extension type in a forward declaration. Also, if the class is
102 defined in a .pxd file, the base class only needs to be specified
103 in the .pxd file, not the .pyx file.
104 [Arc Riley]
106 - There's now an even easier way to forward-declare a struct, union
107 or extension type in another module:
109 from blarg cimport class Foo
111 This simultaneously cimports the name Foo and forward-declares
112 it as an extension type. As well as 'class', you can also use
113 'struct' or 'union'.
115 Modifications:
117 - Casting a non-Python pointer type to a Python type no longer
118 generates an incref, unless one is required for other reasons.
119 [Arc Riley]
121 - More checks added for gil-requiring operations performed without
122 holding the gil.
125 0.9.8
126 -----
128 New features:
130 * Augmented assignment operators (+=, etc.) are now supported.
132 * Package directories
134 Modules in packages no longer need to have dotted names. Instead,
135 a Python-like package directory structure can be used, with
136 package dirs marked by containing an __init__.py or __init__.pyx.
138 Top-level package directories are found by searching the include
139 directories specified by -I options (analogous to PYTHONPATH).
141 * Dependency tracking
143 The Pyrex compiler records information about other source files cimported
144 or included, and can automatically compile all the modules a given module
145 depends on, with timestamp checking.
147 This is enabled by a -r (recursive) option to the compiler, e.g.
149 pyrexc -r mainmodule.pyx
151 There are also two other new command-line options:
153 -t Enable timestamp checking. This is implied with -r.
155 -f Overrides implied -t when using -r and forces all
156 dependent modules to be compiled regardless of timestamps.
158 * Nogil restrictions relaxed
160 C functions declared nogil can now have Python objects as arguments.
161 The argument names are read-only inside the function when this is done.
163 Among other things, this allows C methods to be declared nogil (this
164 couldn't be done before because 'self' is always an object argument).
166 * Circular cimports
168 There is now a way of forward-declaring a struct, union or extension type
169 into another module. This allows two .pxd files to define extension types
170 that refer to each other without running into circular import problems.
171 For example:
173 cimport blarg
174 cdef class blarg.Blarg # Forward declaration
176 cdef class Foo:
177 cdef blarg.Blarg blg
180 0.9.7.2
181 -------
183 Bug fixes:
185 - Another integer indexing problem fixed.
188 0.9.7.1
189 -------
191 Bug fixes:
193 - The optimisation for indexing using a C int failed when the
194 object being indexed was a mapping rather than a sequence.
195 [Arc Riley]
197 Modifications:
199 - Old integer for-loop syntax is no longer deprecated.
202 0.9.7
203 -----
205 New features:
207 - Builtin constants and types are known, and are referenced directly
208 with no dictionary lookup.
210 - Direct calls are made to certain methods of lists and dicts when
211 their type is statically known.
213 - New builtin functions 'typecheck' and 'issubtype' added, providing
214 safer type checking than isinstance and issubclass (which can be
215 overridden).
217 Enhancements:
219 - Redundant type test eliminated when assigning the result of an
220 extension type constructor call to a variable of the same type.
222 - No tp_traverse and tp_clear functions generated for types
223 without Python attributes.
225 - Safer code generated in tp_clear. [Stefan Behnel]
227 - Indexing with a C int type generates calls to PySequence_GetItem
228 and PySequence_SetItem.
230 - Integer for-loop syntax streamlined to 'for x < i < y'.
232 - Appropriate C code generated for compile-time expressions
233 evaluating to float nan, inf and -inf. [Stefan Behnel]
235 Bug fixes:
237 - Value raised by assert statement now only evaluated if the
238 assertion fails. [Stefan Behnel]
240 - Comparing a value of an enum type with another value of a type
241 which is ctypedefed to the same enum type gave a spurious type
242 error. [Matt Hammond]
244 - Comparing an int with a float resulted in the float being cast
245 to an int before comparison. [Robin Becker]
247 - Compiler crashed on an invalid argument to a 'with nogil' statement.
248 [Stefan Behnel]
250 - Incorrect code generated for function with keyword only args
251 and no * or ** args. [Stefan Behnel]
253 - GC type with non-GC base type caused crash due to trying to call
254 non-existent base tp_traverse and tp_clear functions. [Stefan Behnel]
256 - Compile-time IF with no ELSE clause crashed compiler. [Kirk McDonald]
258 - Values in enum declaration were not being checked for appropriate type.
259 [Simon Burton]
261 - Improved the error message from attempting to declare a struct or
262 union member as a function. [Yong Sun]
264 - Referring to an undefined name in a compile-time constant crashed
265 the compiler. [Stefan Behnel]
268 0.9.6.4
269 -------
271 Bug fixes:
273 - Errors in setup.py corrected.
275 - Incorrect error checking code generated for builtin functions
276 and type slots with return type Py_ssize_t. [Robert Bradshaw]
278 - A counted reference was not kept to the module, so if the entry
279 in sys.modules was replaced, the module was freed prematurely.
280 [Franck Pommerau]
282 - A cimport statement inside a function crashed the compiler.
283 [Robert Bradshaw]
285 - __Pyx_ImportModule routine wasn't protected from multiple
286 definition when including _api.h files. [Stefan Behnel]
288 - Temp variables holding exception values were not being set to
289 NULL after use in an except clause. [Robert Bradshaw]
291 - Protect __stdcall and __cdecl from redefinition. [Jim Kleckner]
293 - A temp var was not being set to NULL after api function import
294 code. [Stefan Behnel]
296 - __Pyx_ImportFunction was incorrectly decrefing a borrowed
297 reference. [Stefan Behnel]
299 Enhancements:
301 - Functions declared with_gil and external functions declared nogil
302 are now allowed to have Python arguments and return types.
305 0.9.6.3
306 -------
308 Enhancements:
310 - C API now only uses a single name in the module namespace
311 instead of one for each exported C function. [Stefan Behnel]
313 - Multiple declarations with the same visibility and api options
314 can now be grouped into a 'cdef' block.
316 - The 'api' keyword can now be used on extension types to cause
317 generation of an api.h file when there are no exported C functions.
319 - Added a getattr3() builtin for the three-argument form of getattr.
321 Bug fixes:
323 - Setup.py no longer uses an import to get the version number
324 being installed, to avoid a problem with setuptools.
326 - If a struct or union was forward-declared, certain types of error
327 message misleadingly referenced the source location of the forward
328 declaration rather than the definition.
330 - Calling convention specifier was being emitted in function
331 prototypes but not the corresponding definitions. [Atsuo Ishimoto]
333 - Added support for the --force option to Pyrex.Distutils.
334 [Alexander Belchenko]
336 - Compile-time "==" operator did not work. [Simon King]
338 - Header files generated for public and api declarations now
339 only contain types declared as 'public', instead of all types
340 defined in the module. [Stefan Behnel]
343 0.9.6.2
344 -------
346 Bug fixes:
348 - Corrected a problem with declaration ordering in generated C
349 code involving forward-declared struct, union or extension types.
351 - New distutils extension: Only compile .pyx if it is newer
352 than the corresponding .c file.
355 0.9.6.1
356 -------
358 Bug fixes:
360 - Changed os.uname to platform.uname for portability.
361 [Alexander Belchenko]
363 - Fixed C compiler warning about incompatible types in 2.5.
364 [Alexander Belchenko]
366 - Also fixed a few other 2.5 problems.
368 - Fixed problem with the Extension class in the new Pyrex.Distutils
369 module.
372 0.9.6
373 -----
375 New Features:
377 - Top-level C functions defined in one module can now be used in
378 another via cimport, and a C API can be produced to allow them
379 to be used from C code without linking to the extension module.
380 See "Interfacing with External C Code" and "Sharing Declarations
381 between Pyrex Modules" in the Language Overview. [Stefan Behnel]
383 - Facilities added for releasing the GIL around a section of code
384 and acquiring it on entry to a C function. See "Acquiring and
385 Releasing the GIL under "Interfacing with External C Code" in
386 the Language Overview. [Ulisses Furquim, Stefan Behnel]
388 - Some conditional compilation facilities have been added. See
389 "Conditional Compilation" under "Language Basics" in the
390 Language Overview. [Sam Rushing]
392 Language Changes:
394 - The __new__ special method of extension types is being renamed
395 to "__cinit__". For now, you will get a warning whenever you
396 declare a __new__ method for an extension type, and it will
397 automatically be renamed to __cinit__ for you. In the next
398 release, the warning will become an error and no renaming will
399 occur. In some later release, the __new__ method may be
400 re-introduced with different semantics. It is recommended that
401 you begin updating your sources now to use __cinit__.
403 - A 'raise' statement with no arguments (i.e. to re-raise the
404 last exception caught) is now required to be lexically within
405 the 'except' clause which caught the exception. This change was
406 necessary to efficiently support preserving the exception if an
407 intervening call raises and catches a different exception.
409 - The following new reserved words have been added:
411 with, DEF, IF, ELIF, ELSE
413 Enhancements:
415 - Calls to many of the builtin functions are now compiled as
416 direct calls to Python/C API routines.
418 - A C type explicitly declared as 'signed' is represented as
419 such in the generated code, to acommodate platforms where
420 'char' is unsigned by default. [Francesc Altet]
422 - Python function can now have an argument of type "unsigned
423 char". [Alexander Belchenko]
425 - A new Pyrex.Distutils implementation has been added, which
426 exports an Extension type supporting the following options:
428 pyrex_include_dirs - list of dirs to search for Pyrex header files
429 pyrex_create_listing_file - bool - write errs to listing file
430 pyrex_cplus - bool - generate C++ code
431 pyrex_c_in_temp - bool - put generated C files in temp dir
432 pyrex_gen_pxi - bool - generate .pxi file for public declarations
434 [Contributed by Billie G. Allie]
436 - Assert statements can be compiled out by arranging for
437 PYREX_WITHOUT_ASSERTIONS to be #defined at C compilation time.
438 [Contributed by Stefan Behnel]
440 - Support for __index__ slot added to extension types.
441 [William Stein]
443 - Exception types now properly checked according to pre or post
444 2.5 rules as appropriate.
446 - Py_ssize_t support added. [Stefan Behnel]
448 - Windows __stdcall and __cdecl qualifiers now supported.
449 [Suggested by Eric Devolder]
451 - Keyword-only argument support added. [Suggested by Stefan Behnel]
453 - An 'include' statement can now appear anywhere that another kind
454 of statement or declaration can appear, instead of being restricted
455 to the top level. [Caio Marcelo]
457 - Unnecessary PyErr_Occurred() call to check result of
458 PyString_AsString() no longer made.
460 - Complicated C types are displayed more readably in error messages.
462 Modifications:
464 - A Python function argument declared as "char" or "unsigned
465 char" now expects a Python integer rather than a string of
466 length 1, for consistency with the way automatic conversions
467 are done elsewhere.
469 - Support for string and tuple exceptions dropped.
471 Bug fixes:
473 - If an external ctypedef type was used as the type of an
474 argument to a Python function, a declaration was generated
475 using the underlying type rather than the typedef name.
476 [Francesc Altet]
478 - Some problems with int/enum and pointer/array compatibility
479 fixed. [Eric Huss, Stefan Behnel, Jiba]
481 - Eliminated C compiler warning when comparing an extension
482 type reference to None using 'is' or 'is not'
484 - Eliminated C compiler warnings about docstrings of C functions
485 and special methods being unused. [Francesc Altet]
487 - When compiling with -O, raising an exception in a C function
488 that couldn't propagate exceptions produced a compiler
489 warning about the return value possibly being uninitialised.
491 - Fixed warning about function declaration not being a prototype
492 caused by C method table initialisation code.
494 - Spurious initialisation was generated for unused local variable.
495 [Helmut Jarausch]
497 - Declaration of a non-extern C function without definition
498 was not detected. [Lenard Lindstrom]
500 - Applying ** directly to two C int types is now disallowed due
501 to ambiguity (it's not clear whether to use C pow() or convert
502 to Python ints). [Didier Deshommes]
504 - Traverse and clear code was being inadvertently generated for
505 the __weakref__ slot of a weakly-referenceable extension type.
506 [Peter Johnson]
508 - Statements other than def inside a property declaration were
509 crashing the compiler. [Sven Berkvens]
511 - Defining an extension type with different visibility from its
512 declaration in a .pxd file crashed the compiler.
513 [Alex Coventry]
515 - Instantiating an exception type whose base class __new__ method
516 raises an exception caused a segfault. [Gustavo Sverzut Barbieri]
518 - The 'import pkg.module as name' form of import statement did not
519 work correctly. [Dan]
521 - Fixed error-checking typo in __Pyx_GetStarArgs(). [Eric Huss]
523 - Trailing comma now allowed on argument list. [Jim Kleckner]
525 - Behaviour of reraise made to match Python more closely.
526 [Eric Huss]
528 - An empty C variable declaration crashed the compiler.
530 - Now includes math.h instead of generating own declaration
531 of pow(). [Leif Strand]
533 - Missing import of sys in LinuxSystem.py added. [Scott Jackson]
535 - Typecasts using a ctypedef type were not using the ctypedef
536 name. [Alexander Belchenko]
538 - Workaround added to setup.py for a problem with bdist_wininst.
539 [Alexander Belchenko]
541 - Subtle error in parsing empty function declarators corrected.
543 - Checks added for some type combinations that are illegal in C:
544 array of functions, function returning function or array, cast
545 to a function.
548 0.9.5.1a
549 --------
551 Bug fixes:
553 - Package list now calculated dynamically in setup.py so that
554 it will work with or without the testing framework installed.
557 0.9.5.1
558 -------
560 Bug fixes:
562 - Comparing two values of the same enum type incorrectly
563 produced an error. [Anders Gustafsson]
565 - Compiler crash caused by assigning a Python value to
566 a variable of an enum type. [Peter Johnson]
568 - Comparison between pointer and array incorrectly produced
569 a type mismatch error. [Helmut Jarausch]
571 - Unused local Python variable had spurious init/cleanup code
572 generated for it, causing C compilation errors. [Helmut Jarausch]
574 - Updated list of packages in setup.py.
576 Modifications:
578 - NULL in Pyrex source now translated into NULL instead of 0
579 in C code, to allow for the possibility of calling something
580 not defined with a prototype in an external header. [Adapted Cat]
583 0.9.5
584 -----
586 Enhancements:
588 - Exception return values may now be specified by arbitrary
589 constant expressions of appropriate type, not just literals.
590 [Stefan Behnel]
592 - Redundant type check now omitted when passing a literal None
593 to a function expecting an extension type. [Patch by Sam Rushing]
595 - New-style classes now allowed as exceptions for compatibility
596 with Python 2.5 (inheritance from BaseException not currently
597 checked). [Stefan Behnel]
599 - Sequence unpacking is now done using the iterator protocol
600 instead of indexing.
602 - Allocation of an empty tuple is avoided when making a
603 Python call with no arguments. [Stefan Behnel]
605 - Most warnings about unused variables and labels have been
606 eliminated.
608 - Support for running the test suite on Linux added but not
609 yet fully tested. [Based in part on patch by Eric Wald].
611 - Makefile included for compiling the patched Carbon File module
612 used by the MacOSX test code.
614 Modifications:
616 - Type rules for enums tightened for compatibility with C++.
618 - Direct assignment from float to int disallowed to prevent
619 C++ compilation warnings.
621 - Hex literals left as hex in C code to avoid warnings from
622 the C compiler about decimal constants becoming unsigned.
624 Bug fixes:
626 - Exception raised during argument conversion could cause crash
627 due to uninitialised local variables. [Konrad Hinsen]
629 - Assignment to a C attribute of an extension type from a
630 different type could generate C code with a pointer type
631 mismatch. [Atsuo Ishimoto]
633 - Backslash in a string literal before a non-special character
634 was not handled correctly. [Yuan Mang]
636 - Temporary vars used by del statement not being properly
637 released, sometimes leading to double decrefs. [Jiba]
639 - A return statement whose expression raises an exception
640 inside a try-except that catches the exception could cause
641 a crash. [Anders Gustafsson]
643 - Fixed type compatibility checking problem between pointers
644 and arrays. [Lenard Lindstrom]
646 - Circular imports between modules defining extension types
647 caused unresolvable import order conflicts. [Mike Wyatt]
649 - Cimporting multiple submodules from the same package caused
650 a redefined name error for the top level name. [Martin Albrecht]
652 - Incorrect reference counting when assigning to an element of an
653 array that is a C attribute of an extension type. [Igor Khavkine]
655 - Weak-referenceable extension types were not implemented
656 properly. [Chris Perkins, Peter Johnson]
658 - Crash if C variable declared readonly outside an extension
659 type definition. [Eric Huss]
661 Doc updates:
663 - Expanded discussion of the need for type declarations to enable
664 access to attributes of extension types.
666 - Added a section "Source Files and Compilation" explaining the
667 rules for naming of source files of modules residing in packages,
668 and instructions for using the compiler and distutils extension.
671 0.9.4.1
672 -------
674 Bug fixes:
676 - Fixed indentation problem in Pyrex.Distutils.build_ext.
677 [Oliver Grisel]
680 0.9.4
681 -----
683 Improvements:
685 - All use of lvalue casts has been eliminated, for
686 compatibility with gcc4.
688 - PyMODINIT_FUNC now used to declare the module init function.
690 - Generated code should be compilable as either C or C++.
691 When compiling as C++, "extern C" is used where appropriate
692 to preserve linkage semantics.
694 - An extension type can be made weak-referenceable by
695 giving it a C attribute of type object called __weakref__.
697 - Source files opened in universal newlines mode.
699 - Support for public extension type C attributes of type
700 long long and unsigned long long added (but not tested).
701 [Sam Rushing]
703 - Distutils include directories now passed to Pyrex compiler.
704 [Konrad Hinsen]
706 - Integer constants with an "L" suffix are now allowed
707 and are converted to Python long integers. [Rainer Deyke]
709 - A broken .c file is no longer left behind if there are
710 compilation errors.
712 - Using the result of a Python indexing or attribute access
713 operation as a char * is no longer considered an error in
714 most cases, as the former behaviour proved to be more
715 annoying than helpful.
717 Bug fixes:
719 - Fixed problems with conversion from Python integers to
720 C unsigned longs. Now use PyInt_AsUnsignedLongMask and
721 PyInt_AsUnsignedLongLongMask instead of the PyLong_*
722 functions (which only work on Python longs). [Wim Vree]
724 - C unsigned ints now converted to/from Python longs intead
725 of Python ints to avoid overflow problems. [Heiko Wundram]
727 - Correct PyArg_ParseTuple format characters now used for
728 unsigned types. [Jeff Bowden]
730 - Nonzero return value from a base class tp_traverse call
731 is handled.
733 - Taking sizeof an incomplete type caused a crash while
734 producing an error message. [Drew Perttula]
736 - If a module cimported itself, definitions of global variables
737 were generated twice. [Parzival Herzog]
739 - Distutils extension updated to handle changed signature of
740 swig_sources(). [David M. Cooke]
742 - Incorrect C code generated for a raw string containing a double
743 quote preceded by a backslash. [Thomas Drake]
745 - Declaration of public C function with an exception value written
746 to generated .pxi file without the except clause. [Robby Dermody]
748 - __delitem__ method of an extension type with no __setitem__
749 did not get called. [Richard Boulton]
751 - A spurious Py_INCREF was generated when a return statement
752 required a type test. [Jonathan Doda]
754 - Casting a value to a function pointer and then immediately
755 calling it generated a cast to a function instead of a cast
756 to a function pointer. [Simon Burton]
758 - Py_TPFLAGS_HAVE_GC was not being set on an extension type that
759 inherited from an external extension type that used GC but did
760 not itself have any PyObject* attributes.
761 [Michael Hordijk]
763 - A return statement inside a for statement leaked a reference
764 to the loop's iterator.
765 [Jürgen Kartnaller]
767 - Full module name now appears in __module__ attribute of classes
768 and extension types, provided a correct dotted name is used
769 for the .pyx file. [Giovanni Bajo]
771 - Public extension type with no C attributes produced an
772 invalid .pxi file. [Simon Burton]
774 - Using a dict constructor as the second operand of a boolean
775 expression crashed the Pyrex compiler.
776 [Stefan Behnel]
778 - A C declaration list ending with a comma resulted in invalid
779 C code being generated. [Alex Coventry]
781 - A raw string containing two consecutive backslashes produced
782 incorrect C code. [Helmut Jarausch]
784 - An error is reported if you attempt to declare a special
785 method of an extension type using 'cdef' instead of 'def'.
786 [Sam Rushing]
788 0.9.3
789 -----
791 Enhancements:
793 - Types defined with a ctypedef in a 'cdef extern from' block
794 are now referred to by the typedef name in generated C code,
795 so it is no longer necessary to match the type in the C
796 header file exactly.
798 - Conversion to/from unsigned long now done with
799 PyLong_AsUnsignedLong and PyLong_FromUnsignedLong. [Dug Song]
801 - A struct, union or enum definition in a 'cdef extern from'
802 block may now be left empty (using 'pass'). This can be useful
803 if you need to declare a variable of that type, but don't need
804 to refer to any of its members.
806 - More flexible about ordering of qualifiers such as 'long' and
807 'unsigned'. ["John (J5) Palmieri"]
810 Bug fixes:
812 - Non-interned string literals used in a Python class
813 definition did not work. [Atsuo Ishimoto, Andreas Kostyrka]
815 - Return types of the buffer interface functions for extension
816 types have been corrected. [Dug Song]
818 - Added 'static' to declarations of string literals. [Phil Frost]
820 - Float literals are now copied directly to the C code as written,
821 to avoid problems with loss of precision. [Mario Pernici]
823 - Inheriting from an extension type with C methods defined in
824 another Pyrex module did not work. [Itamar Shtull-Trauring]
826 0.9.2.1
827 -------
829 Bug fixes:
831 - Corrected an import statement setup.py, and made it
832 check for a unix platform in a more reliable way.
834 0.9.2
835 -----
837 Enhancements:
839 - Names of Python global variables and attributes are now
840 interned, and PyObject_GetAttr/SetAttr are used instead
841 of PyObject_GetAttrString/SetAttrString. String literals
842 which resemble Python identifiers are also interned.
844 - String literals are now converted to Python objects only
845 once instead of every time they are used.
847 - NUL characters are now allowed in Python string literals.
849 - Added some missing error checking code to the beginning
850 of module init functions. It's unlikely the operations
851 involved would ever fail, but you never know.
853 Bug fixes:
855 - Corrected some problems introduced by moving the Plex
856 package.
858 0.9.1.1
859 -------
861 Bug fixes:
863 - Corrected a problem in the setup.py (pyrexc script incorrectly
864 named).
866 - Updated the distutils extension to match changes in the
867 Pyrex compiler calling interface.
869 - Doing 'make clean' in Demos/callback was removing a little too
870 much (that's why cheesefinder.c kept disappearing).
872 0.9.1
873 -----
875 Enhancements:
877 - A C method can now call an inherited C method by the usual
878 Python technique. [Jiba]
880 - The __modname__ of a Python class is now set correctly. [Paul Prescod]
882 - A MANIFEST.in file has been added to the distribution to
883 facilitate building rpms. [contributed by Konrad Hinsen]
885 Bug fixes:
887 - Conditional code now generated to allow for the renaming of LONG_LONG
888 to PY_LONG_LONG that occurred between Python 2.2 and 2.3.
890 - Header files referenced in cimported modules were not being included.
891 [Tom Popovich]
893 - References to C functions and variables in a cimported module were
894 not being recognised if made from within a local scope. [Tom Popovich]
896 - Spurious declarations in code generated for a "finally" block.
897 [Brandon Long]
899 - Attempting to return a value from a __contains__ method didn't work.
900 [Andreas Kostyrka]
902 - Incorrect code generated for an extension type with C methods
903 inheriting from a base type with no C methods. [Robin Becker]
905 - Failure to report an error if a C method was defined in the
906 implementation part of an extension type that was not declared
907 in the corresponding definition part. Documentation also updated
908 to explain that this is necessary. [Jiba]
910 - Made it an error to forward-declare an extension type with
911 a different base class specification from its subsequent
912 definition. [Jiba]
914 - C attributes of an extension type were not being propagated
915 through more than one level of inheritance. [Jiba]
917 - If a garbage collection occurred early enough in the __new__
918 method of an extension type with Python-valued C attributes,
919 a crash could occur in its tp_traverse function.
920 [reported by Jiba, fix suggested by Paul Prescod]
922 - An empty vtable struct is no longer generated for extension
923 types with no C methods. [Robin Becker]
925 - Memory was leaked in the sq_item function of an extension
926 type with a __getitem__ method. [Atsuo Ishimoto]
928 - Code generated to work around a bug in some versions of Python
929 2.2 which fails to initialise the tp_free slot correctly in
930 some circumstances. [Matthias Baas]
932 - Compiler crash when defining an extension type with a base
933 class specified by a dotted name. [Alain Pointdexter]
935 - Referencing an extension type defined in a cimported module
936 at run time did not work correctly. [Alain Pointdexter]
938 - Incorrect object struct code generated for an extension type
939 whose base class was defined in a .pxd file. [Alain Pointdexter]
941 - Redeclaring a type that wasn't previously an extension type
942 as an extension type caused a compiler crash. [Scott Robinson]
944 - Incorrect code was generated for return statements in a
945 special method with no return value. [Gary Bishop]
947 - Single-line def statement did not work. [Francois Pinard]
949 Modifications:
951 - Only the last pathname component of the .pyx file is reported in
952 backtraces now. [Bryan Weingarten]
954 - Documentation corrected to remove the erroneous statement that
955 extension classes can have a __del__ method. [Bryan Weingarten]
957 - Note added to documentation explaining that it is not possible
958 for an extension type's __new__ method to explicitly call the
959 inherited __new__ method.
961 - The version of Plex included with Pyrex is now installed
962 as a subpackage of the Pyrex package, rather than as a
963 top-level package, so as not to interfere with any other
964 version of Plex the user may have installed.
966 0.9
967 ---
969 New features:
971 - Extension types can have properties. See the new "Properties"
972 section in the "Extension Types" page.
974 - An extension type can inherit from a builtin type or another
975 extension type. See "Subclassing" in the "Extension Types" page.
977 - Extension types can have C methods, which can be overridden
978 in derived extension types. See "C Methods" in the "Extension Types"
979 page.
981 Enhancements:
983 - Conversion is now performed between C long longs and Python
984 long integers without chopping to the size of a C long.
985 Also the Python PY_LONG_LONG type is now used for long longs
986 for greater portability.
988 Bug fixes:
990 - Names were sometimes being generated that were insufficiently
991 unique in the presence of cimported declarations.
993 - Changed the way the included filename table is declared from
994 char *[] to char **, to stop MSVC from complaining about it
995 having an unknown size. [Alexander A Naanou]
997 - Second argument of assert statement was not being coerced
998 to a Python value. [Francois Pinard]
1000 - Return statement without value wasn't accepted in some
1001 extension type special methods when it should have been.
1002 [Francois Pinard]
1004 - Attempting to call a non-function C value crashed the
1005 compiler. [John J Lee]
1007 - Functions declared as "except *" were not returning exceptions.
1008 [John J Lee]
1010 - A syntax warning from Plex about assignment to None has
1011 been eliminated. [Gordon Williams]
1013 - Public function declaration with empty argument list was
1014 producing (void) in .pxi file. [Michael P. Dubner]
1016 - Incorrect error signalling code was being generated in the
1017 __hash__ special method of an extension type.
1020 0.8.1
1021 -----
1023 Bug fixes:
1025 - Names of structs, unions and enums in external header
1026 files were getting mangled when they shouldn't have been.
1027 [Norman Shelley]
1029 - Modified distutils extension so that it will stop before
1030 compiling the C file if the Pyrex compiler reports errors.
1031 [John J Lee]
1034 0.8
1035 ---
1037 New features:
1039 - INCOMPATIBLE CHANGE: The type object of an external extension
1040 type is now imported at run time using the Python import
1041 mechanism. To make this possible, an 'extern' extension type
1042 declaration must DECLARE THE MODULE from which the extension
1043 type originates. See the new version of the "Extension Types"
1044 documentation for details.
1046 This change was made to eliminate the need for Pyrex to be
1047 told the C name of the type object, or for the Pyrex module
1048 to be linked against the object code providing the type object.
1050 You will have to update any existing external extension type
1051 declarations that you are using. I'm sorry about that, but it
1052 was too hard to support both the old and new ways.
1054 - Compile-time importing: A Pyrex module can now import declarations
1055 from another Pyrex module using the new 'cimport' statement. See
1056 the new section on "Sharing Declarations Between Pyrex Modules" in
1057 the documentation.
1059 Minor improvements:
1061 - An error is reported if you declare a struct, union or
1062 extension type using 'cdef' in one place and 'ctypedef'
1063 in another.
1065 - Struct, union and extension types can only be forward-
1066 declared using 'cdef', not 'ctypedef' (otherwise invalid
1067 C code would be generated).
1069 - The 'global' statement can be used at the module level to
1070 declare that a name is a module-level name rather than a
1071 builtin. This can be used to access module attributes such
1072 as __name__ that would otherwise be assumed to be builtins.
1073 [Pat Maupin]
1075 - The 'assert' statement now accepts a second argument.
1076 [Francois Pinard]
1078 Bug fixes:
1080 - When using Python 2.3, "True" or "False" could sometimes
1081 turn up in generated code instead of "1" or "0". [Adam Hixson]
1083 - Function return value not always converted to or from a
1084 Python object when it should have been.
1086 - Certain kinds of error in a function call expression
1087 could crash the compiler. ["Edward C. Jones"]
1089 - Fixed memory leak in functions with * or ** args. [Alexander A Naanou]
1092 0.7.1
1093 -----
1095 Bug fixes:
1097 - Calling a function declared as returning an extension
1098 type could crash the compiler.
1100 - A function call with type errors in the argument list
1101 could crash the compiler.
1103 - An 'else' clause on a for-from statement could crash
1104 the compiler.
1106 - Incorrect casting code was generated when a generic
1107 object argument of a special method was declared as
1108 being of an extension type. [Phillip J. Eby]
1110 - A blank line that couldn't be interpreted wholly as
1111 a valid indentation sequence caused a syntax error.
1112 In particular, a formfeed character on an otherwise
1113 blank line wasn't accepted. [Francois Pinard]
1115 - Parallel assignments were incorrectly optimised.
1117 - A bare tuple constructor with an extra comma at the
1118 end of a line caused a syntax error.
1120 0.7
1121 ---
1123 New features:
1125 - Attributes of extension types can be exposed to Python
1126 code, either read/write or read-only.
1128 - Different internal and external names can be specified
1129 for C entities.
1131 - None is a compile-time constant, and more efficient code
1132 is generated to reference it.
1134 - Command line options for specifying directories to
1135 search for include files.
1137 Enhancements:
1139 - More efficient code is generated for access to Python
1140 valued C attributes of extension types.
1142 - Cosmetic code improvement: Less casting back and forth
1143 between extension types and PyObject * when referencing
1144 C members of the object struct.
1146 - C arguments and variables declared as an extension type
1147 can take the value None.
1149 - Form feed characters are accepted as whitespace.
1151 - Function names in tracebacks are qualified with
1152 module name and class name.
1154 Bug fixes:
1156 - A sufficiently complex expression in a boolean context
1157 could cause code to be generated twice for the same
1158 subexpression.
1160 - Incorrect casting code was generated when passing an
1161 extension type to a function expecting a generic Python
1162 object.
1164 - Executable statements are now disallowed inside a
1165 cdef class block (previously they silently caused
1166 crazy C code to be generated).
1168 - Tracebacks should now report the correct filename for
1169 functions defined in files included with the 'include'
1170 statement.
1172 - The documentation incorrectly claimed that an extension
1173 type can't have a __del__ method. In fact, it can, and
1174 it behaves as expected.
1177 0.6.1
1178 -----
1180 Bug fixes:
1182 - Fixed broken distutils extension.
1186 0.6
1187 ---
1189 New features:
1191 - Command line options for reporting version number,
1192 requesting a listing file and specifying the name of
1193 the generated C file.
1195 - An 'include' statement allows inclusion of declarations
1196 from other Pyrex source files.
1198 - If there are any public declarations, a Pyrex include
1199 file is generated (as well as a .h file) containing
1200 declarations for them.
1202 - Extension types can be declared public, so their C
1203 attributes are visible to other Pyrex and C code.
1205 - Try-except statements can now have an 'else' clause.
1206 [Francois Pinard]
1208 - Multiple simple statements can be placed on one line
1209 separated by semicolons.
1211 - A suite consisting of a simple statement list can now
1212 be placed on the same line after the colon in most
1213 cases. [Francois Pinard]
1215 - The automatic coercion of a C string to a C char has
1216 been removed (it proved to be too error-prone).
1217 Instead, there is a new form of literal for C
1218 character constants: c'X'
1220 - The __get__ special method (used by descriptor objects)
1221 now allows for the possibility of the 2nd or 3rd
1222 arguments being NULL. Also the __set__ method has been
1223 split into two methods, __set__ and __delete__.
1224 [Phillip J. Eby]
1226 Bug fixes:
1228 - Values unpacked into a non-Python destination variable
1229 were not being converted before assignment. [Gareth Watts]
1231 - Hex constants greater than 0x7fffffff caused compiler
1232 to crash. [Gareth Watts]
1234 - Type slots are no longer statically initialised with
1235 extern function pointers, to avoid problems with
1236 some compilers. The hack in the distutils extension
1237 to work around this by compiling as C++ has been
1238 disabled. [Phillip J. Eby]
1240 - Fixed several more instances of the error-reporting
1241 routine being called with arguments in the wrong
1242 order. Hoping I've *finally* got all of them now...
1244 - Nested for-from loops used the same control variable.
1245 [Sebastien de Menten]
1247 - Fixed some other error message related bugs. [Francois Pinard]
1249 - Assigning to slice didn't work. [Francois Pinard]
1251 - Temp variables were being declared as extension
1252 types and then being assigned PyObject *'s. All
1253 Python temp vars are now declared as PyObject *.
1254 [Francois Pinard]
1256 0.5
1257 ---
1259 Bug fixes:
1261 - Algorithm for allocating temp variables redesigned
1262 to fix various errors concerning temp
1263 variable re-use. [Mark Rowe]
1265 - Memory leak occured sometimes when an implicit
1266 type test was applied to the result of an
1267 expression. [Christoph Wiedemann]
1269 - __set__ method of extension types had wrong
1270 signature. [Josh Littlefield]
1272 0.4.6
1273 -----
1275 Bug fixes:
1277 - Indexing multi-dimensional C arrays didn't
1278 work. [Gary Dietachmayer]
1281 0.4.5
1282 -----
1284 New features:
1286 - There is now a 'public' declaration for
1287 making Pyrex-defined variables and functions
1288 available to external C code. A .h file is
1289 also generated if there are any public
1290 declarations.
1292 Enhancements:
1294 - Defining __len__/__getitem__ methods in an
1295 extension class fills sq_length/sq_item slots
1296 as well as mp_length/mp_subscript. [Matthias Baas]
1298 - The Distutils extension now allows .c files
1299 to be incorporated along with .pyx files.
1300 [Modification to Distutils extension contributed
1301 by Darrell Gallion]
1303 Bug fixes:
1305 - Float literals without a decimal point
1306 work again now. [Mike Rovner, Peter Lepage]
1308 - Compiler crashed if exception value didn't
1309 match function return type. [Michael JasonSmith]
1311 - The setup.py file should now install the
1312 Lexicon.pickle file in the right place.
1313 [Patch supplied by David M. Cooke]
1315 - Compiler crashed when compiling a C function that
1316 returned an extension type.
1317 [David M. Cooke]
1319 - Anonymous enum types did not have C code
1320 suppressed inside an extern-from block. [Matthew Mueller]
1323 0.4.4
1324 -----
1326 Enhancements:
1328 - Tracebacks now extend into Pyrex function
1329 calls and show line numbers in the Pyrex
1330 source file.
1332 - Syntax for float literals made more lenient
1333 (no longer requires digits both before and
1334 after the point). [Peter Lepage]
1336 - Method calls can be made on string literals
1337 (e.g. ",".join(x)). [Pedro Rodriguez]
1339 Bug fixes:
1341 - Incorrect refcount code generated when a
1342 Python function needing argument type tests
1343 had local Python variables. [Matthias Baas]
1345 - 'self' parameter of __getitem__ method of
1346 extension type had wrong implicit type. [Peter Lepage]
1348 - Repaired breakage introduced by trying to
1349 allow an empty parameter list to be written
1350 as (void). No longer attempting to allow
1351 this (too hard to parse correctly). [Peter Lepage]
1353 - Found bug in Plex 1.1.2 which was the *real*
1354 cause of the two-newlines-in-a-row problem.
1355 Removed the Opt(Eol)+Str("\n") hacks in
1356 the scanner which were working around this
1357 before. [Pedro Rodriguez]
1359 - __call__ special method of extension types
1360 had wrong signature. [Peter Lepage]
1363 0.4.3
1364 -----
1366 New language features:
1368 - For-from loop for iterating over integer
1369 ranges, using pure C loop where possible.
1371 Enhancements:
1373 - sizeof() can now be applied to types as
1374 well as variables.
1376 - Improved handling of forward-declared
1377 extension types.
1379 Bug fixes:
1381 - Two newlines in a row in a triple quoted
1382 string caused a parse error on some
1383 platforms. [Matthias Baas]
1385 - Fixed problem with break and continue in
1386 the else-clause of a loop.
1389 0.4.2
1390 -----
1392 New language features:
1394 - C functions can be declared as having an
1395 exception return value, which is checked
1396 whenever the function is called. If an
1397 exception is detected inside a C function
1398 for which no exception value is declared,
1399 a warning message is printed and the
1400 exception is cleared.
1402 - Cascaded assignments (i.e. a = b = c
1403 are now supported.
1405 - Anonymous enum declarations are allowed,
1406 for when you just want to declare constants.
1408 - The C types "long long" and "long double"
1409 are now understood. Also, "int" is optional
1410 after "short" or "long".
1412 Enhancements:
1414 - A * argument in a function call can now be
1415 any sequence, not just a tuple.
1417 - A C char* or char[] will be turned into
1418 a char by taking its first character if
1419 used in a context where a char is required,
1420 thus allowing a string literal to be used as
1421 a char literal.
1423 - C string * C int or vice versa is now
1424 interpreted as Python string replication.
1426 - Function arguments are checked for void or
1427 incomplete type.
1429 Bug fixes:
1431 - Non-external extension types show up in the
1432 module dict once more (this got broken in
1433 0.4.1).
1435 - A spurious decref has been removed from the
1436 runtime support code for the "import" statement.
1437 Hopefully this will prevent the crashes some
1438 people have been experiencing when importing
1439 builtin modules. [Mathew Yeates]
1441 0.4.1
1442 -----
1444 New language features:
1446 - "ctypedef struct/union/enum/class" statements
1447 added, for use in extern-from blocks when a
1448 header file uses a ctypedef to declare a
1449 tagless struct, union or enum type.
1451 - "pass" allowed in an extern-from block.
1453 - "cdef extern from *" for when you don't want
1454 to specify an include file name.
1456 - Argument names may be omitted in function
1457 signatures when they're not needed.
1459 - New reserved word NULL for the null C pointer.
1461 Compiler enhancements:
1463 - Lexicon is now picked in binary format, so
1464 startup should be much faster on slower
1465 machines.
1467 - If Pyrex decides to rebuild the lexicon and
1468 then finds that it can't write a pickle file,
1469 it now prints a warning and carries on
1470 instead of crashing.
1472 - Chat about hash codes and lexicon pickling
1473 now turned off by default except when creating
1474 a new lexicon (which ought never happen now
1475 unless you change the scanner).
1477 Bug fixes:
1479 - Modified the runtime support code for "import"
1480 statements, hopefully fixing problem with using
1481 a Pyrex module in conjunction with py2exe.
1483 - DL_EXPORT now used in both the prototype and
1484 definition of the module init function.
1486 - Exception state is now saved and restored around
1487 calls to an extension type __dealloc__ method,
1488 to avoid screwing up if the object is deallocated
1489 while an exception is being propagated.
1491 - Making an attribute reference to a method of
1492 an extension type caused a compiler crash.
1494 - Doc string in new-style class definition
1495 caused a run-time error.
1497 - Insufficient parentheses were put around C type
1498 casts.
1500 - Constructors for extension types are now read-only
1501 C global variables instead of entries in the
1502 module dict. This change was needed to prevent
1503 Numeric from blowing up due to touching its
1504 typeobject before import_numeric() could be called.
1506 0.4
1507 ---
1509 New features:
1511 - "cdef extern from" statement allows inclusion
1512 of C header files to be specified, solving
1513 a number of problems including:
1514 - Clashes between Pyrex and C declarations,
1515 due to "const" and other reasons
1516 - Windows-specific features required in
1517 function declarations
1518 - Helping deal with types such as "size_t"
1519 - Helping deal with functions defined as
1520 macros
1522 - Access to internals of pre-existing extension
1523 types is now possible by placing an extension
1524 type declaration inside a "cdef extern from"
1525 block.
1527 Bug fixes:
1529 - Error not reported properly when passing
1530 wrong number of args to certain special
1531 methods of extension types. [Mitch Chapman]
1533 - Compile-time crash when defining an extension
1534 type with a __hash__ method.
1536 Minor enhancements:
1538 - Hashing of the scanner source file made more
1539 platform-independent, making spurious regeneration
1540 of the pickle less likely.
1543 0.3.4
1544 -----
1546 Bug fixes:
1548 - Runtime crash when using * or ** args in
1549 a method of an extension type fixed. [Matthew Mueller]
1551 - Compiler crash when using default argument
1552 values in a method of a Python class. [Mike Rovner]
1554 Enhancements:
1556 - Type slots filled with functions from outside
1557 the extension module are now initialised dynamically,
1558 which should eliminate at least some of the
1559 "initialiser is not constant" problems experienced
1560 on Windows. [Marek Baczek]
1562 - On Windows, __declspec(dllexport) is now used for
1563 the module init func declaration (or should be --
1564 I haven't tested this). [Marek Baczek]
1566 - The compiler shouldn't attempt to rewrite the
1567 Lexicon.pickle file unless the source has been
1568 changed (hashing is used now instead of comparing
1569 timestamps). So there should be no problem any more
1570 with installing Pyrex read-only.
1572 0.3.3
1573 -----
1575 Bug fixes:
1577 * A void * can be assigned from any other
1578 pointer type.
1579 * File names in error messages no longer
1580 quoted (this was apparently confusing some
1581 editors). [Matthew Mueller]
1583 * Reference to a struct member which is an
1584 array is coerced to a pointer. [Matthew Mueller]
1586 * Default argument values did not work
1587 in methods of an extension type. [Matthew Mueller]
1589 * Single or double quote characters in a
1590 triple-quoted string didn't work. [Matthew Mueller]
1592 * Using *args in a function definition
1593 sometimes caused a crash at runtime. [Matthew Mueller]
1595 * A hack is included which tries to make
1596 functions in Python.h which use 'const'
1597 accessible from Pyrex. But it doesn't
1598 work on all platforms. Thinking about a
1599 better solution.
1602 New features:
1604 * Comment containing Pyrex version number
1605 and date/time at top of generated C file. [Matthias Baas]
1608 0.3.2
1609 -----
1611 Bug fixes:
1613 * The & operator works again. [Matthias Baas]
1615 * The & operator had incorrect precedence.
1617 * "SystemError: 'finally' pops bad exception"
1618 under some circumstances when raising an
1619 exception. [Matthias Baas]
1621 * Calling a Python function sometimes leaked
1622 a reference.
1624 * Crash under some circumstances when casting
1625 a Python object reference to a C pointer type.
1626 [Michael JasonSmith]
1628 * Crash when redeclaring a function. [Matthias Baas]
1630 * Crash when using a string constant inside
1631 a Python class definition. [Mike Rovner]
1633 * 2-element slice indexing expressions. [Mike Rovner]
1635 * Crash when encountering mixed tabs and
1636 spaces. [Mike Rovner]
1638 New features:
1640 * A wider variety of constant expressions is
1641 now accepted for enum values, array
1642 dimensions, etc. [Mike Rovner]
1645 0.3.1
1646 -----
1648 New features:
1650 * More special methods for extension types:
1651 __delitem__, __delslice__, __getattr__,
1652 __setattr__, __delattr__
1654 * Module-level variable of a Python object type
1655 declared with 'cdef' is private to the module, and
1656 held in a C variable instead of the module dict.
1658 * External C functions with variable argument lists
1659 can be declared and called.
1661 * Pyrex-defined Python functions can have default
1662 argument values and * and ** arguments, and can be
1663 called with keyword arguments.
1665 * Pointer-to-function types can be declared.
1667 * Pyrex now supports a declaration syntax that
1668 C doesn't! Example:
1670 cdef (int (*)()) foo() # function returning a function ptr
1672 * There is now a ctypedef statement.
1674 * Extension types can now be forward-declared.
1676 * All permutations of (non-Unicode) string literals
1677 and escape codes should work now.
1679 * Hex and octal integer literals.
1681 * Imaginary number literals.
1683 * Docstrings are now supported.
1685 Bug fixes:
1687 * Type tests are performed when using a Python object
1688 in a context requiring a particular extension type.
1690 * Module-level variable holding the type object
1691 of an extension type had incorrect type.
1693 0.3
1694 ---
1696 New features:
1698 * Extension types! Yay!
1700 0.2.2
1701 -----
1703 Bug fixes:
1705 * Fixed error message generation again after a previous
1706 bug was accidentally re-indroduced.
1708 * Removed the declaration of isspace() from the code
1709 generated for print statement support (it's not needed
1710 and was conflicting with the system-supplied one on
1711 some platforms).
1713 0.2
1714 ---
1716 New features:
1718 * Executable statements are now allowed at the
1719 top level of a module.
1721 * Python class definitions are now supported, with
1722 the following limitations:
1724 - Class definitions are only allowed at the top
1725 level of a module, not inside a control structure
1726 or function or another class definition.
1728 - Assigning a Pyrex-defined Python function to a
1729 class attribute outside of the class definition
1730 will not create a method (because it's not an
1731 interpreted Python function and therefore
1732 won't trigger the bound-method creation magic).
1734 - The __metaclass__ mechanism and the creation of
1735 new-style classes is not (yet) supported.
1737 * Casting between Python and non-Python types is
1738 better supported.
1740 Bug fixes:
1742 * Fixed bug preventing for-loops from working.
1745 0.1.1
1746 -----
1748 * I've discovered a flaw in my algorithm for releasing
1749 temp variables. Fixing this properly will require some
1750 extensive reworking; I've put in a hack in the meantime
1751 which should work at the cost of using more temp variables
1752 than are strictly necessary.
1754 * Fixed bug preventing access to builtin names from
1755 working. This should also have fixed the import
1756 statement, but I haven't tested it.
1758 * Fixed some errors in __Pyx_GetExcValue.
1760 * Fixed bug causing boolean expressions to malfunction
1761 sometimes.