cython.git
17 years agocache builtins at module level
Robert Bradshaw [Thu, 25 Oct 2007 04:35:02 +0000 (21:35 -0700)]
cache builtins at module level

17 years agoGenerate module cleanup code
Robert Bradshaw [Wed, 24 Oct 2007 11:50:55 +0000 (04:50 -0700)]
Generate module cleanup code

Decref cdef globals, interned values, and imported types

17 years agoFix builtins caching
Robert Bradshaw [Wed, 24 Oct 2007 08:41:16 +0000 (01:41 -0700)]
Fix builtins caching

17 years agoCleanup builtin function code
Robert Bradshaw [Wed, 24 Oct 2007 08:14:41 +0000 (01:14 -0700)]
Cleanup builtin function code

17 years agoEnable relative cimports
Robert Bradshaw [Wed, 24 Oct 2007 07:15:01 +0000 (00:15 -0700)]
Enable relative cimports

17 years agoDecref error in except clause
Robert Bradshaw [Wed, 24 Oct 2007 07:14:26 +0000 (00:14 -0700)]
Decref error in except clause

Temporary variables must be set to zero or they might be XDECREF'ed later, generating very hard to track bugs.

17 years agopackage-local import patch reverted
Stefan Behnel [Sun, 21 Oct 2007 12:20:59 +0000 (14:20 +0200)]
package-local import patch reverted

17 years agoctypedef casting, more cdef extern class work
Robert Bradshaw [Sun, 21 Oct 2007 08:01:15 +0000 (01:01 -0700)]
ctypedef casting, more cdef extern class work

17 years agoFix ctypedef extern class, assignment on declaration, redeclaration warnings
Robert Bradshaw [Sun, 21 Oct 2007 05:05:04 +0000 (22:05 -0700)]
Fix ctypedef extern class, assignment on declaration, redeclaration warnings

17 years agomerge (including cwitty's change to get_exception_utility_code)
Robert Bradshaw [Sat, 20 Oct 2007 19:18:21 +0000 (12:18 -0700)]
merge (including cwitty's change to get_exception_utility_code)

17 years agoindent fix
Stefan Behnel [Thu, 18 Oct 2007 07:44:58 +0000 (09:44 +0200)]
indent fix

17 years agogreg: Tests passed
Stefan Behnel [Thu, 18 Oct 2007 07:43:42 +0000 (09:43 +0200)]
greg: Tests passed

17 years agoAdded getattr3() builtin
Stefan Behnel [Thu, 18 Oct 2007 06:55:15 +0000 (08:55 +0200)]
Added getattr3() builtin

17 years agoGeneral cdef block
Stefan Behnel [Thu, 18 Oct 2007 06:44:40 +0000 (08:44 +0200)]
General cdef block

17 years agoOnly include public types in generated headers
Stefan Behnel [Thu, 18 Oct 2007 06:30:08 +0000 (08:30 +0200)]
Only include public types in generated headers

17 years agoFix C API namespace pollution
Stefan Behnel [Thu, 18 Oct 2007 06:22:31 +0000 (08:22 +0200)]
Fix C API namespace pollution

17 years agoFix king1 - compile time == operator
Stefan Behnel [Thu, 18 Oct 2007 06:00:18 +0000 (08:00 +0200)]
Fix king1 - compile time == operator

17 years agogreg: Add --force support to distutils extension
Stefan Behnel [Wed, 17 Oct 2007 17:55:51 +0000 (19:55 +0200)]
greg: Add --force support to distutils extension

17 years agogreg: Fix ishimoto4 - calling convention omitted from func defn
Stefan Behnel [Wed, 17 Oct 2007 17:52:35 +0000 (19:52 +0200)]
greg: Fix ishimoto4 - calling convention omitted from func defn

17 years agoremoved debug code
Stefan Behnel [Wed, 17 Oct 2007 07:55:16 +0000 (09:55 +0200)]
removed debug code

17 years agoimport modules only once, support module-level imports
Stefan Behnel [Wed, 17 Oct 2007 06:44:32 +0000 (08:44 +0200)]
import modules only once, support module-level imports

17 years agopreliminary merge of Pyrex 0.9.6.2 -> crashes
Stefan Behnel [Mon, 15 Oct 2007 08:26:57 +0000 (10:26 +0200)]
preliminary merge of Pyrex 0.9.6.2 -> crashes

17 years agoFix __Pyx_GetExcValue to avoid (possibly) running Python code while the thread state...
Carl Witty [Sun, 14 Oct 2007 06:26:39 +0000 (23:26 -0700)]
Fix __Pyx_GetExcValue to avoid (possibly) running Python code while the thread state is inconsistent

17 years agomerged in changes from Cython 0.9.6.7
Stefan Behnel [Sat, 13 Oct 2007 07:25:05 +0000 (09:25 +0200)]
merged in changes from Cython 0.9.6.7

17 years agomerge of Pyrex 0.9.6.2
Stefan Behnel [Fri, 12 Oct 2007 16:26:51 +0000 (18:26 +0200)]
merge of Pyrex 0.9.6.2

17 years agoNew version
Robert Bradshaw [Thu, 11 Oct 2007 08:43:09 +0000 (01:43 -0700)]
New version

17 years agoInterned integer constants, created at module load time.
Robert Bradshaw [Thu, 11 Oct 2007 08:33:28 +0000 (01:33 -0700)]
Interned integer constants, created at module load time.

For example, in the SAGE source we have

1158 PyInt_FromLong(0)
 776 PyInt_FromLong(1)
 258 PyInt_FromLong(2)
  33 PyInt_FromLong(3)
  21 PyInt_FromLong(10)

and a thousand or so others... Who knows how many of these are in loops too.

17 years agoMinor bug fixes
Robert Bradshaw [Thu, 11 Oct 2007 06:31:46 +0000 (23:31 -0700)]
Minor bug fixes

17 years agoimported added files of Pyrex 0.9.6.2
Stefan Behnel [Thu, 11 Oct 2007 06:10:20 +0000 (08:10 +0200)]
imported added files of Pyrex 0.9.6.2

17 years agoimport of Pyrex 0.9.6.2
Stefan Behnel [Thu, 11 Oct 2007 06:08:56 +0000 (08:08 +0200)]
import of Pyrex 0.9.6.2

17 years agordef keyword for overridable methods
Robert Bradshaw [Wed, 10 Oct 2007 11:32:21 +0000 (04:32 -0700)]
rdef keyword for overridable methods

17 years agoError message (rather than traceback) on missing name in cdef declarator
Robert Bradshaw [Wed, 10 Oct 2007 10:19:20 +0000 (03:19 -0700)]
Error message (rather than traceback) on missing name in cdef declarator

17 years agoFix c++ error when using 'is' with different types.
Robert Bradshaw [Wed, 10 Oct 2007 09:46:46 +0000 (02:46 -0700)]
Fix c++ error when using 'is' with different types.

17 years agobugfix: avoid emitting code that closes a comment in the annotation comment
Thomas Hunger [Tue, 9 Oct 2007 15:20:56 +0000 (17:20 +0200)]
bugfix: avoid emitting code that closes a comment in the annotation comment

17 years agoUse PyObject_RichCompare rather than PyObject_Cmp
Robert Bradshaw [Wed, 10 Oct 2007 09:15:39 +0000 (02:15 -0700)]
Use PyObject_RichCompare rather than PyObject_Cmp
This is what the interpreter does, and allows one to
get at the actual object (rather than just its truth
value).

17 years agomerge changes for 0.9.6.7 release
Robert Bradshaw [Mon, 8 Oct 2007 18:10:00 +0000 (11:10 -0700)]
merge changes for 0.9.6.7 release

17 years ago(Python) override modifier for cdef methods
Robert Bradshaw [Tue, 2 Oct 2007 07:39:41 +0000 (00:39 -0700)]
(Python) override modifier for cdef methods

17 years agoanother fix to make it work with Robert's signature optimisation
Stefan Behnel [Sun, 23 Sep 2007 20:12:36 +0000 (22:12 +0200)]
another fix to make it work with Robert's signature optimisation

17 years agofix to still support a keyword dictionary besides kw-only args
Stefan Behnel [Sun, 23 Sep 2007 19:55:25 +0000 (21:55 +0200)]
fix to still support a keyword dictionary besides kw-only args

17 years agosupport for keyword-only arguments and required keywords (PEP 3102)
Stefan Behnel [Sun, 23 Sep 2007 19:26:36 +0000 (21:26 +0200)]
support for keyword-only arguments and required keywords (PEP 3102)

17 years agoFix traceback on conditional expression error
Robert Bradshaw [Tue, 25 Sep 2007 23:05:17 +0000 (16:05 -0700)]
Fix traceback on conditional expression error

17 years agosupport for keyword-only arguments and required keywords (PEP 3102)
Stefan Behnel [Sun, 23 Sep 2007 19:26:36 +0000 (21:26 +0200)]
support for keyword-only arguments and required keywords (PEP 3102)

17 years agoUse assert instead of if without else to ensure an object pointer is not NULL.
Thomas Hunger [Fri, 21 Sep 2007 11:16:39 +0000 (13:16 +0200)]
Use assert instead of if without else to ensure an object pointer is not NULL.

gcc complained that a variable might be used uninitialized, which is
true. If NULL is passed, all code gets executed with an
uninitialized variable which is an error in almost every case.
Since python itself never passes NULL, only a real error in
other c code could trigger the assert.

17 years agoThe changes for code execution registered the
Thomas Hunger [Wed, 19 Sep 2007 22:28:47 +0000 (00:28 +0200)]
The changes for code execution registered the
scope-entry as a variable. This means that
analyse_attribute expects to find a pointer to
a member of the c-object struct.
This is not the case for members, so we need a
special case.

17 years agoUse assignable_from for conditional node
Robert Bradshaw [Tue, 25 Sep 2007 21:47:12 +0000 (14:47 -0700)]
Use assignable_from for conditional node

Fixes

cdef int a, b
cdef int *foo = &a if a else &b

17 years agoUse PY_VERSION_HEX rather than sys.version_info for typeslot versioning.
Robert Bradshaw [Wed, 19 Sep 2007 22:35:13 +0000 (15:35 -0700)]
Use PY_VERSION_HEX rather than sys.version_info for typeslot versioning.

so the generated c files don't depend on the version of python used to run Cython

17 years agoAdd versioning to slots so that additional
Thomas Hunger [Wed, 19 Sep 2007 21:15:34 +0000 (23:15 +0200)]
Add versioning to slots so that additional
slots for new pyton versions are not emitted
for older versions. This stops compiler warnings.

17 years agoFix classmethod for use in cdef classes.
Robert Bradshaw [Wed, 19 Sep 2007 20:26:34 +0000 (13:26 -0700)]
Fix classmethod for use in cdef classes.

The issue here (as pointed out by Thomas Hunger) is that once the CClass
body gets executed the class is already constructed, and its methods
are actual methods not functions (as in Python).

The CClassScope now returns a utility function on lookup of "classmethod"
that creates a class method out of a method (rather than out of a function).
When added to the type dictionary, the result is exactly the same as setting
the METH_CLASS flag.

17 years agoChanged the assigment code generator to emit
Thomas Hunger [Wed, 19 Sep 2007 13:40:17 +0000 (15:40 +0200)]
Changed the assigment code generator to emit
a direct change of a classes tp_dict instead
of SetAttr if assignment code is executed in
a class body.
To tell the code generator that we have a class
entry, entry has a new attribute "is_member".

17 years agoEmit and release temporary variables in global namespace
Thomas Hunger [Wed, 19 Sep 2007 10:47:06 +0000 (12:47 +0200)]
Emit and release temporary variables in global namespace
because the class-body code is exectuted at module-init time.

17 years agoFinish class members
Robert Bradshaw [Wed, 19 Sep 2007 01:56:46 +0000 (18:56 -0700)]
Finish class members

17 years agoClass members in cdef classes
Robert Bradshaw [Wed, 19 Sep 2007 00:56:11 +0000 (17:56 -0700)]
Class members in cdef classes

17 years agopartial code for execution in classes
tom@tom [Tue, 18 Sep 2007 17:43:44 +0000 (19:43 +0200)]
partial code for execution in classes

17 years agoremoved callable() again
Stefan Behnel [Sat, 15 Sep 2007 13:29:25 +0000 (15:29 +0200)]
removed callable() again

17 years agoremoved getattr() optimisation as it disables the usage of a default value
Stefan Behnel [Sat, 15 Sep 2007 11:44:57 +0000 (13:44 +0200)]
removed getattr() optimisation as it disables the usage of a default value

17 years agoanother signature fix, support for issubclass() and callable()
Stefan Behnel [Sat, 15 Sep 2007 10:56:40 +0000 (12:56 +0200)]
another signature fix, support for issubclass() and callable()

17 years ago[has|get|set]attr() optimisation (fix for setattr)
Stefan Behnel [Sat, 15 Sep 2007 10:43:21 +0000 (12:43 +0200)]
[has|get|set]attr() optimisation (fix for setattr)

17 years ago[has|get|set]attr() optimisation
Stefan Behnel [Sat, 15 Sep 2007 10:39:56 +0000 (12:39 +0200)]
[has|get|set]attr() optimisation

17 years agosupport method slots specific to a Python version
Stefan Behnel [Thu, 13 Sep 2007 14:37:05 +0000 (16:37 +0200)]
support method slots specific to a Python version

17 years agomerge from 0.9.6.6
Stefan Behnel [Wed, 12 Sep 2007 08:15:04 +0000 (10:15 +0200)]
merge from 0.9.6.6

17 years agouse 'with GIL' instead of 'withGIL' to avoid introducing a non-Python keyword and...
Stefan Behnel [Tue, 11 Sep 2007 19:12:49 +0000 (21:12 +0200)]
use 'with GIL' instead of 'withGIL' to avoid introducing a non-Python keyword and to support later extension for other contexts

17 years agouse 'with GIL' instead of 'withGIL' to avoid introducing a non-Python keyword and...
Stefan Behnel [Tue, 11 Sep 2007 19:12:49 +0000 (21:12 +0200)]
use 'with GIL' instead of 'withGIL' to avoid introducing a non-Python keyword and to support later extension for other contexts

17 years agosupport automatic GIL grabbing inside a function by addign 'withGIL' to its signature
Stefan Behnel [Mon, 10 Sep 2007 21:00:48 +0000 (23:00 +0200)]
support automatic GIL grabbing inside a function by addign 'withGIL' to its signature

17 years agoType check after (not before) operation on inplace assignment.
Robert Bradshaw [Tue, 11 Sep 2007 23:39:51 +0000 (16:39 -0700)]
Type check after (not before) operation on inplace assignment.

17 years agosupport automatic GIL grabbing inside a function by addign 'withGIL' to its signature
Stefan Behnel [Mon, 10 Sep 2007 21:00:48 +0000 (23:00 +0200)]
support automatic GIL grabbing inside a function by addign 'withGIL' to its signature

17 years agoenable attribute access of cdef functions
Robert Bradshaw [Mon, 10 Sep 2007 17:35:20 +0000 (10:35 -0700)]
enable attribute access of cdef functions

17 years agoCheck return values before PyErr_Occurred() for coercion nodes.
Robert Bradshaw [Fri, 7 Sep 2007 09:49:43 +0000 (02:49 -0700)]
Check return values before PyErr_Occurred() for coercion nodes.

17 years agoincref_local_binop option for SAGE
Robert Bradshaw [Wed, 5 Sep 2007 23:43:04 +0000 (16:43 -0700)]
incref_local_binop option for SAGE

This is so mutating inplace operations can be detected safely.

17 years agoBetter error for ** on integer types.
Robert Bradshaw [Wed, 5 Sep 2007 18:39:47 +0000 (11:39 -0700)]
Better error for ** on integer types.

17 years agofixed typo
Stefan Behnel [Mon, 3 Sep 2007 18:07:01 +0000 (20:07 +0200)]
fixed typo

17 years agodo not use __builtin_expect with GCC < 2.96
Stefan Behnel [Mon, 3 Sep 2007 14:17:12 +0000 (16:17 +0200)]
do not use __builtin_expect with GCC < 2.96

17 years agodo not use __builtin_expect with GCC < 2.96
Stefan Behnel [Mon, 3 Sep 2007 14:17:12 +0000 (16:17 +0200)]
do not use __builtin_expect with GCC < 2.96

17 years agorewrote Python 2.5-ism
Stefan Behnel [Mon, 3 Sep 2007 14:13:26 +0000 (16:13 +0200)]
rewrote Python 2.5-ism

17 years agofixed typo
Stefan Behnel [Mon, 3 Sep 2007 18:07:01 +0000 (20:07 +0200)]
fixed typo

17 years agorewrote Python 2.5-ism
Stefan Behnel [Mon, 3 Sep 2007 14:13:26 +0000 (16:13 +0200)]
rewrote Python 2.5-ism

17 years agoversion update
Stefan Behnel [Fri, 31 Aug 2007 09:58:13 +0000 (11:58 +0200)]
version update

17 years agofix for property functions
Stefan Behnel [Sat, 25 Aug 2007 17:01:14 +0000 (19:01 +0200)]
fix for property functions

17 years agofix for property functions
Stefan Behnel [Sat, 25 Aug 2007 17:01:14 +0000 (19:01 +0200)]
fix for property functions

17 years agomerge of 0.9.6.4
Stefan Behnel [Sat, 25 Aug 2007 17:00:31 +0000 (19:00 +0200)]
merge of 0.9.6.4

17 years agoavoid argument parsing (via meth_o, meth_noargs) for non-python-object arguments...
Robert Bradshaw [Sun, 19 Aug 2007 11:14:41 +0000 (04:14 -0700)]
avoid argument parsing (via meth_o, meth_noargs) for non-python-object arguments, upgrade version number to 0.9.6.4

compiles and runs SAGE fine

17 years agoremove pointer warning for generic arguments
Robert Bradshaw [Sun, 19 Aug 2007 10:56:31 +0000 (03:56 -0700)]
remove pointer warning for generic arguments

17 years agometh_o and meth_noargs for module-level functions
Robert Bradshaw [Sun, 19 Aug 2007 07:44:50 +0000 (00:44 -0700)]
meth_o and meth_noargs for module-level functions

previous patch was just for classes

17 years agoAvoid call to PyArg_ParseTupleAndKeywords for zero- and single-argument functions.
Robert Bradshaw [Sun, 19 Aug 2007 02:44:28 +0000 (19:44 -0700)]
Avoid call to PyArg_ParseTupleAndKeywords for zero- and single-argument functions.

17 years agoPyObject -> Py_ssize_t now uses __index__ rather than __int__ (even in function signa...
Robert Bradshaw [Sun, 19 Aug 2007 00:40:39 +0000 (17:40 -0700)]
PyObject -> Py_ssize_t now uses __index__ rather than __int__ (even in function signatures)

17 years agoCorrect flags on special methods so one can call their python functions directly.
Robert Bradshaw [Fri, 17 Aug 2007 23:11:06 +0000 (16:11 -0700)]
Correct flags on special methods so one can call their python functions directly.

17 years agoDocstrings for special methods
Robert Bradshaw [Fri, 17 Aug 2007 22:46:16 +0000 (15:46 -0700)]
Docstrings for special methods

17 years agoversion number
Robert Bradshaw [Fri, 17 Aug 2007 22:06:54 +0000 (15:06 -0700)]
version number

17 years agoRaise error when declaring reserved names.
Robert Bradshaw [Fri, 17 Aug 2007 08:47:56 +0000 (01:47 -0700)]
Raise error when declaring reserved names.

17 years agohonour Extension.include_dirs
Stefan Behnel [Mon, 6 Aug 2007 06:45:11 +0000 (08:45 +0200)]
honour Extension.include_dirs

17 years agoextract Cython 'cplus' option from Extension 'language' option
Stefan Behnel [Mon, 6 Aug 2007 06:36:52 +0000 (08:36 +0200)]
extract Cython 'cplus' option from Extension 'language' option

17 years agosupport 'language' option in distutils Extension
Stefan Behnel [Mon, 6 Aug 2007 06:19:48 +0000 (08:19 +0200)]
support 'language' option in distutils Extension

17 years agodebug code left over
Stefan Behnel [Fri, 3 Aug 2007 13:35:52 +0000 (15:35 +0200)]
debug code left over

17 years agoinitial support for unicode literals in UTF-8
Stefan Behnel [Wed, 1 Aug 2007 23:43:48 +0000 (01:43 +0200)]
initial support for unicode literals in UTF-8

17 years agoextract FQ module name from distutils
Stefan Behnel [Mon, 30 Jul 2007 20:18:23 +0000 (22:18 +0200)]
extract FQ module name from distutils

17 years agoversion number 0.9.6.5
Robert Bradshaw [Wed, 29 Aug 2007 21:54:29 +0000 (14:54 -0700)]
version number 0.9.6.5

17 years agoextract FQ module name from distutils
Stefan Behnel [Mon, 30 Jul 2007 20:18:23 +0000 (22:18 +0200)]
extract FQ module name from distutils

17 years agoFixed some typos reported by Helmut Jarausch
William Stein [Sun, 29 Jul 2007 16:38:20 +0000 (09:38 -0700)]
Fixed some typos reported by Helmut Jarausch

17 years agoremove gcc dependance for inline, branch prediction
Robert Bradshaw [Sun, 29 Jul 2007 01:30:36 +0000 (18:30 -0700)]
remove gcc dependance for inline, branch prediction

17 years agoMore Pyrex --> Cython conversions.
William Stein [Sat, 28 Jul 2007 20:48:10 +0000 (13:48 -0700)]
More Pyrex --> Cython conversions.

17 years agoA few more Pyrex --> Cython changes.
William Stein [Sat, 28 Jul 2007 20:42:16 +0000 (13:42 -0700)]
A few more Pyrex --> Cython changes.