cython.git
15 years agoFix bug #252, mangle illegal optional c argument names. 0.12.alpha0
Robert Bradshaw [Thu, 5 Nov 2009 05:41:14 +0000 (21:41 -0800)]
Fix bug #252, mangle illegal optional c argument names.

15 years agoTests for ticket #446.
Robert Bradshaw [Thu, 5 Nov 2009 05:02:09 +0000 (21:02 -0800)]
Tests for ticket #446.

15 years agoFix ticket #446 (non-float complex regression).
Robert Bradshaw [Thu, 5 Nov 2009 05:01:27 +0000 (21:01 -0800)]
Fix ticket #446 (non-float complex regression).

15 years agorun gc after running a test, prevent the test runner from dead-locking on broken...
Stefan Behnel [Tue, 3 Nov 2009 20:14:10 +0000 (21:14 +0100)]
run gc after running a test, prevent the test runner from dead-locking on broken tests

15 years agoFix #441
Dag Sverre Seljebotn [Tue, 3 Nov 2009 15:35:19 +0000 (16:35 +0100)]
Fix #441

15 years agoOptimized list pop.
Robert Bradshaw [Tue, 3 Nov 2009 09:01:54 +0000 (01:01 -0800)]
Optimized list pop.

15 years agoOptional forking in runtests.py
Robert Bradshaw [Tue, 3 Nov 2009 08:56:50 +0000 (00:56 -0800)]
Optional forking in runtests.py

15 years agoTemporary fix for #441
Dag Sverre Seljebotn [Mon, 2 Nov 2009 19:50:02 +0000 (20:50 +0100)]
Temporary fix for #441

15 years agomerge
Dag Sverre Seljebotn [Mon, 2 Nov 2009 19:23:21 +0000 (20:23 +0100)]
merge

15 years agoFix #444 (utility code not pulled in in corner case)
Dag Sverre Seljebotn [Mon, 2 Nov 2009 19:23:01 +0000 (20:23 +0100)]
Fix #444 (utility code not pulled in in corner case)

15 years agocleanup
Stefan Behnel [Sun, 1 Nov 2009 15:58:44 +0000 (16:58 +0100)]
cleanup

15 years agodisable compile time error in favour of a runtime error as it might be too strict...
Stefan Behnel [Sun, 1 Nov 2009 14:16:58 +0000 (15:16 +0100)]
disable compile time error in favour of a runtime error as it might be too strict and break working code

15 years agotest __new__() optimisation interaction with __cinit__()
Stefan Behnel [Sun, 1 Nov 2009 13:01:50 +0000 (14:01 +0100)]
test __new__() optimisation interaction with __cinit__()

15 years agocomplex number coercion fix
Robert Bradshaw [Sat, 31 Oct 2009 20:52:55 +0000 (13:52 -0700)]
complex number coercion fix

15 years agoFix complex zero division testing.
Robert Bradshaw [Sat, 31 Oct 2009 20:42:53 +0000 (13:42 -0700)]
Fix complex zero division testing.

15 years agofix tp_new() function return type
Stefan Behnel [Sat, 31 Oct 2009 15:46:48 +0000 (16:46 +0100)]
fix tp_new() function return type

15 years agofix C assignment issue for the typed target case
Stefan Behnel [Sat, 31 Oct 2009 14:35:48 +0000 (15:35 +0100)]
fix C assignment issue for the typed target case

15 years agoadd a None check, except for plain extension type names
Stefan Behnel [Sat, 31 Oct 2009 13:17:41 +0000 (14:17 +0100)]
add a None check, except for plain extension type names

15 years agooptimise MyType.__new__(MyType) into a tp_new() slot call
Stefan Behnel [Sat, 31 Oct 2009 13:01:34 +0000 (14:01 +0100)]
optimise MyType.__new__(MyType) into a tp_new() slot call

15 years agoPy3 test fix
Stefan Behnel [Fri, 30 Oct 2009 12:51:28 +0000 (13:51 +0100)]
Py3 test fix

15 years agoPy3 doctest fix
Stefan Behnel [Fri, 30 Oct 2009 12:26:34 +0000 (13:26 +0100)]
Py3 doctest fix

15 years agovarious Py3 test fixes after doctest refactoring
Stefan Behnel [Fri, 30 Oct 2009 12:07:57 +0000 (13:07 +0100)]
various Py3 test fixes after doctest refactoring

15 years agoremove sage-specific and unused incref-local-binop option
Robert Bradshaw [Fri, 30 Oct 2009 06:23:27 +0000 (23:23 -0700)]
remove sage-specific and unused incref-local-binop option

15 years agorewrite of C array iteration support to iterate directly over pointers instead of...
Stefan Behnel [Thu, 29 Oct 2009 16:00:34 +0000 (17:00 +0100)]
rewrite of C array iteration support to iterate directly over pointers instead of ints

15 years agoextended test case
Stefan Behnel [Thu, 29 Oct 2009 15:55:00 +0000 (16:55 +0100)]
extended test case

15 years agofix #442: non-pyobject for-in-loop targets failed with enumerate() optimisation
Stefan Behnel [Thu, 29 Oct 2009 11:59:58 +0000 (12:59 +0100)]
fix #442: non-pyobject for-in-loop targets failed with enumerate() optimisation

15 years agoMove some tests into function docstrings.
Robert Bradshaw [Thu, 29 Oct 2009 11:25:40 +0000 (04:25 -0700)]
Move some tests into function docstrings.

15 years agoextended/fixed test case
Stefan Behnel [Thu, 29 Oct 2009 10:32:06 +0000 (11:32 +0100)]
extended/fixed test case

15 years agooptimise calls to int() and float() for casting purposes
Stefan Behnel [Thu, 29 Oct 2009 10:29:16 +0000 (11:29 +0100)]
optimise calls to int() and float() for casting purposes

15 years agouse plain malloc/free in freezing code
Robert Bradshaw [Thu, 29 Oct 2009 08:30:02 +0000 (01:30 -0700)]
use plain malloc/free in freezing code

15 years agoT442, not T441.
Robert Bradshaw [Thu, 29 Oct 2009 08:01:26 +0000 (01:01 -0700)]
T442, not T441.

15 years agoTest fixes for T441 enumerate bug.
Robert Bradshaw [Thu, 29 Oct 2009 07:59:28 +0000 (00:59 -0700)]
Test fixes for T441 enumerate bug.

15 years agoWorkaround for T441, enumerate optimization bug.
Robert Bradshaw [Thu, 29 Oct 2009 07:59:03 +0000 (00:59 -0700)]
Workaround for T441, enumerate optimization bug.

15 years agoFix to compile sage.
Robert Bradshaw [Thu, 29 Oct 2009 06:36:46 +0000 (23:36 -0700)]
Fix to compile sage.

Was giving a gcc error for a local named "zero"

15 years agoDisable embedded testing for Py3 (can't run Cython).
Robert Bradshaw [Thu, 29 Oct 2009 05:53:25 +0000 (22:53 -0700)]
Disable embedded testing for Py3 (can't run Cython).

15 years agoadd embedding to the test suite
Robert Bradshaw [Thu, 29 Oct 2009 05:49:36 +0000 (22:49 -0700)]
add embedding to the test suite

15 years agoTest for --embedded mode.
Robert Bradshaw [Thu, 29 Oct 2009 05:12:14 +0000 (22:12 -0700)]
Test for --embedded mode.

15 years agoFix complex return values
Dag Sverre Seljebotn [Wed, 28 Oct 2009 16:10:12 +0000 (17:10 +0100)]
Fix complex return values

15 years agomerge
Dag Sverre Seljebotn [Wed, 28 Oct 2009 15:26:04 +0000 (16:26 +0100)]
merge

15 years agoTestcase: Coercing typedef float to complex miscompiles
Dag Sverre Seljebotn [Wed, 28 Oct 2009 15:25:32 +0000 (16:25 +0100)]
Testcase: Coercing typedef float to complex miscompiles

15 years agoextended test case for ticket 252
Stefan Behnel [Wed, 28 Oct 2009 13:29:21 +0000 (14:29 +0100)]
extended test case for ticket 252

--HG--
rename : tests/compile/bad_c_struct_T252.pyx => tests/run/bad_c_struct_T252.pyx

15 years agoSyntax highlighting for Cython and NumPy for KATE and KDevelop.
Sturla Molden [Wed, 28 Oct 2009 09:57:23 +0000 (02:57 -0700)]
Syntax highlighting for Cython and NumPy for KATE and KDevelop.

15 years agomerge
Robert Bradshaw [Wed, 28 Oct 2009 09:51:14 +0000 (02:51 -0700)]
merge

15 years agoadded doctest to compile test case
Stefan Behnel [Wed, 28 Oct 2009 07:57:12 +0000 (08:57 +0100)]
added doctest to compile test case

--HG--
rename : tests/compile/coercearraytoptr.pyx => tests/run/coercearraytoptr.pyx

15 years agoextended test case to make sure the ref-count optimisation strikes
Stefan Behnel [Wed, 28 Oct 2009 07:02:03 +0000 (08:02 +0100)]
extended test case to make sure the ref-count optimisation strikes

15 years agodrop ref-counting on C attribute swaps
Stefan Behnel [Wed, 28 Oct 2009 06:23:17 +0000 (07:23 +0100)]
drop ref-counting on C attribute swaps

15 years agoPy3 test fixes
Stefan Behnel [Tue, 27 Oct 2009 22:04:32 +0000 (23:04 +0100)]
Py3 test fixes

15 years agotest fixes for Py2.4
Stefan Behnel [Tue, 27 Oct 2009 20:57:28 +0000 (21:57 +0100)]
test fixes for Py2.4

15 years agomerge
Dag Sverre Seljebotn [Tue, 27 Oct 2009 19:18:19 +0000 (20:18 +0100)]
merge

15 years agonumpy.pxd: Add intp_t and uintp_t
Dag Sverre Seljebotn [Tue, 27 Oct 2009 19:18:02 +0000 (20:18 +0100)]
numpy.pxd: Add intp_t and uintp_t

15 years agoefficiently support for-in loops over char* arrays/pointers
Stefan Behnel [Tue, 27 Oct 2009 11:51:12 +0000 (12:51 +0100)]
efficiently support for-in loops over char* arrays/pointers

15 years agoNicer error message for undeclared[idx]
Dag Sverre Seljebotn [Mon, 26 Oct 2009 11:56:23 +0000 (12:56 +0100)]
Nicer error message for undeclared[idx]

15 years agocheck for bytes.decode() optimisation in test case
Stefan Behnel [Mon, 26 Oct 2009 08:49:46 +0000 (09:49 +0100)]
check for bytes.decode() optimisation in test case

15 years agoextended test case
Stefan Behnel [Mon, 26 Oct 2009 08:43:14 +0000 (09:43 +0100)]
extended test case

15 years agodrop redundant specialisation code from for-in loop if we know it's not a list or...
Stefan Behnel [Mon, 26 Oct 2009 08:42:20 +0000 (09:42 +0100)]
drop redundant specialisation code from for-in loop if we know it's not a list or tuple

15 years agocleanup, support unbound method calls to bytes.decode()
Stefan Behnel [Mon, 26 Oct 2009 06:52:43 +0000 (07:52 +0100)]
cleanup, support unbound method calls to bytes.decode()

15 years agoticket 436: efficiently support char*.decode() through C-API calls
Stefan Behnel [Sun, 25 Oct 2009 20:28:56 +0000 (21:28 +0100)]
ticket 436: efficiently support char*.decode() through C-API calls

15 years agoadd missing slots 'tp_del' (Py>=2.3) and 'tp_version_tag' (Py>=2.6)
Lisandro Dalcin [Sun, 25 Oct 2009 19:28:03 +0000 (17:28 -0200)]
add missing slots 'tp_del' (Py>=2.3) and 'tp_version_tag' (Py>=2.6)

15 years agofix intern() test in Py3
Stefan Behnel [Sun, 25 Oct 2009 08:17:08 +0000 (09:17 +0100)]
fix intern() test in Py3

15 years agofix testcase
Lisandro Dalcin [Sat, 24 Oct 2009 21:18:52 +0000 (19:18 -0200)]
fix testcase

15 years agoBetter makefile clean.
Robert Bradshaw [Sat, 24 Oct 2009 20:44:36 +0000 (13:44 -0700)]
Better makefile clean.

Bug and fix reported by Mark Lodato.

15 years ago--embed mode: fix Py3, floating point on FreeBSD
Mark Lodato [Sat, 24 Oct 2009 20:17:23 +0000 (16:17 -0400)]
--embed mode: fix Py3, floating point on FreeBSD

Incorporate the changes of cython_freeze:
* fix when compiling on Python 3 (Issue #434)
* fix floating point issues on FreeBSD

15 years agofreeze: fix for compiling with Python3
Mark Lodato [Sat, 24 Oct 2009 19:37:28 +0000 (15:37 -0400)]
freeze: fix for compiling with Python3

To get the output of cython_freeze to compile with both Python 2 and
Python 3, I copied the contents of Python-3.1.1/Modules/python.c, with
some slight modifications.  The main issue is that Python 3 uses
wchar_t, while Python 2 uses char.  It also appears that the
Py_FlushLine/PyErr_Clear is not needed in Python 3.

Related to #434: "main() function generated by --embed doesn't compile
in Py3"

15 years agofreeze: exit(2) in examples, to test exit code
Mark Lodato [Sat, 24 Oct 2009 19:01:29 +0000 (15:01 -0400)]
freeze: exit(2) in examples, to test exit code

The cython_freeze-generated executable exits with code 1 if something
wrong happens, unless a SystemExit exception occurred, in which case it
returns the value passed to sys.exit().  In order to differentiate
between the two cases, change the two example Cython modules to exit(2).

15 years agofreeze: include FreeBSD fix from Python's main()
Mark Lodato [Sat, 24 Oct 2009 18:40:41 +0000 (14:40 -0400)]
freeze: include FreeBSD fix from Python's main()

Copy the fix for floating point exceptions on FreeBSD from Python's
Module/python.c.

15 years agofreeze: Makefile: use -fno-strict-aliasing
Mark Lodato [Mon, 12 Oct 2009 04:17:47 +0000 (00:17 -0400)]
freeze: Makefile: use -fno-strict-aliasing

Python 2 cannot compile with strict aliasing, so the Cython modules
should really be compiled with -fno-strict-aliasing.  See Issue #395.

15 years agofreeze: Makefile: add target to build README.html
Mark Lodato [Mon, 5 Oct 2009 02:36:40 +0000 (22:36 -0400)]
freeze: Makefile: add target to build README.html

Add a target (with alias "html") to build README.html from README.txt
using rst2html.  This is not run by default.

15 years agofreeze: rename README.rst to README.txt
Mark Lodato [Mon, 5 Oct 2009 02:34:48 +0000 (22:34 -0400)]
freeze: rename README.rst to README.txt

The only reason I had a "rst" extension was so that GitHub would pick it
up.

--HG--
rename : Demos/freeze/README.rst => Demos/freeze/README.txt

15 years agofreeze: add --pymain example
Mark Lodato [Mon, 5 Oct 2009 00:07:28 +0000 (20:07 -0400)]
freeze: add --pymain example

Add an example of building a --pymain Python interpreter to the README
and to the Makefile.

15 years agofreeze: add -p option for calling Py_Main()
Mark Lodato [Mon, 5 Oct 2009 00:03:20 +0000 (20:03 -0400)]
freeze: add -p option for calling Py_Main()

Add an option to build a regular interpreter, calling Py_Main(), rather
than running the first module as __main__.

15 years agofreeze: remove blank lines from beginning and end
Mark Lodato [Mon, 5 Oct 2009 00:02:03 +0000 (20:02 -0400)]
freeze: remove blank lines from beginning and end

15 years agofreeze: add -o option for setting output file
Mark Lodato [Mon, 5 Oct 2009 00:01:27 +0000 (20:01 -0400)]
freeze: add -o option for setting output file

15 years agofreeze: use optparse to parse arguments
Mark Lodato [Mon, 5 Oct 2009 00:00:32 +0000 (20:00 -0400)]
freeze: use optparse to parse arguments

15 years agofreeze: Makefile: flags from distutils.sysconfig
Mark Lodato [Sun, 4 Oct 2009 23:39:07 +0000 (19:39 -0400)]
freeze: Makefile: flags from distutils.sysconfig

Instead of hard-coding the compiler flags and libraries, extract them
from distutils.sysconfig.

15 years agofreeze: README: fix typos and mistakes in example
Mark Lodato [Sun, 4 Oct 2009 23:32:43 +0000 (19:32 -0400)]
freeze: README: fix typos and mistakes in example

I mis-spelled "combinatorics", and I forgot to use the -c flag to gcc.

15 years agofreeze: Makefile: only clean specific C files
Mark Lodato [Sun, 4 Oct 2009 23:31:26 +0000 (19:31 -0400)]
freeze: Makefile: only clean specific C files

15 years agofreeze: remove mistaken semicolon
Mark Lodato [Sun, 4 Oct 2009 23:29:54 +0000 (19:29 -0400)]
freeze: remove mistaken semicolon

15 years agofreeze: fix cmath.pyx when run as __main__
Mark Lodato [Tue, 6 Oct 2009 01:37:12 +0000 (21:37 -0400)]
freeze: fix cmath.pyx when run as __main__

15 years agofreeze: fix Makefile's CYTHON path
Mark Lodato [Sun, 4 Oct 2009 22:45:27 +0000 (18:45 -0400)]
freeze: fix Makefile's CYTHON path

15 years agofreeze: rename cython_freeze.py to cython_freeze
Mark Lodato [Sat, 3 Oct 2009 19:55:55 +0000 (15:55 -0400)]
freeze: rename cython_freeze.py to cython_freeze

--HG--
rename : bin/cython_freeze.py => bin/cython_freeze

15 years agofreeze: in documentation, reference Demos/freeze
Mark Lodato [Sun, 4 Oct 2009 22:25:32 +0000 (18:25 -0400)]
freeze: in documentation, reference Demos/freeze

The files originally had README.rst in the top level and the examples in
the example directory, but now all are in Demos/freeze.

15 years agofix identifier decoding check
Stefan Behnel [Sat, 24 Oct 2009 13:43:24 +0000 (15:43 +0200)]
fix identifier decoding check

15 years agofix exec in Py2.3
Stefan Behnel [Sat, 24 Oct 2009 13:28:56 +0000 (15:28 +0200)]
fix exec in Py2.3

15 years agomissing weakref .pxd file, include all python_*.pxd files in python.pxd, test their...
Stefan Behnel [Sat, 24 Oct 2009 13:12:23 +0000 (15:12 +0200)]
missing weakref .pxd file, include all python_*.pxd files in python.pxd, test their cimport

15 years agoremoved dead comment
Stefan Behnel [Sat, 24 Oct 2009 09:30:00 +0000 (11:30 +0200)]
removed dead comment

15 years agominor refactoring, use 'notnone=True' in type tests
Stefan Behnel [Sat, 24 Oct 2009 08:59:41 +0000 (10:59 +0200)]
minor refactoring, use 'notnone=True' in type tests

15 years agoprevent warnings when compiling with `gcc -Wextra`
Mark Lodato [Mon, 12 Oct 2009 16:37:59 +0000 (12:37 -0400)]
prevent warnings when compiling with `gcc -Wextra`

The PyInt conversion functions generate two warnings when compiled under
`gcc -Wall -Wextra`:

1. comparison of unsigned expression < 0 is always false

2. signed and unsigned type in conditional expression

This patch fixes these problems by creating a new temporary variable
`is_unsigned`, which fixes problem 1, and by converting the ternary
return expression into a normal if/else branch, which fixes problem 2.

15 years agoadditional test for type casts (ticket #417)
Lisandro Dalcin [Fri, 23 Oct 2009 18:41:24 +0000 (16:41 -0200)]
additional test for type casts (ticket #417)

--HG--
extra : rebase_source : 3512ea980463bae13f30b0d8bd395cabe253e65c

15 years agoExtension type cast should reject None (ticket #417)
Lisandro Dalcin [Thu, 22 Oct 2009 20:42:30 +0000 (18:42 -0200)]
Extension type cast should reject None (ticket #417)

--HG--
extra : rebase_source : 37bb9de5574e1f7b4f288192eaa3c70a2ae350ca

15 years agonumpy.pxd: add NPY_UINT64 and family
Mark Lodato [Fri, 16 Oct 2009 23:38:02 +0000 (19:38 -0400)]
numpy.pxd: add NPY_UINT64 and family

This provides a fast way to check to see the data type of an ndarray.
For example, to check to see if an integer is 64 bits:

    PyArray_TYPE(a) == NPY_UINT64 or PyArray_TYPE(a) == NPY_INT64

15 years agonumpy.pxd: fix typo PyArray_ISISCONTIGUOUS
Mark Lodato [Fri, 16 Oct 2009 23:28:49 +0000 (19:28 -0400)]
numpy.pxd: fix typo PyArray_ISISCONTIGUOUS

15 years agoapplied pyximport patch from ticket 312
Stefan Behnel [Fri, 23 Oct 2009 16:56:48 +0000 (18:56 +0200)]
applied pyximport patch from ticket 312

15 years agofix cascade order of assignments for complete assignments within parallel assignments
Stefan Behnel [Fri, 23 Oct 2009 13:53:24 +0000 (15:53 +0200)]
fix cascade order of assignments for complete assignments within parallel assignments

15 years agomore .pxd cleanups
Stefan Behnel [Fri, 23 Oct 2009 13:39:32 +0000 (15:39 +0200)]
more .pxd cleanups

--HG--
rename : Cython/Includes/python_string.pxd => Cython/Includes/python_bytes.pxd
rename : Cython/Includes/python_parse.pxd => Cython/Includes/python_getargs.pxd

15 years agofix bug 409: use cascaded assignments also for the complete rhs when optimising paral...
Stefan Behnel [Fri, 23 Oct 2009 08:10:14 +0000 (10:10 +0200)]
fix bug 409: use cascaded assignments also for the complete rhs when optimising parallel assignments

15 years agoFix #250, Traceback method name is wrong for exceptions caught in methods
Robert Bradshaw [Fri, 23 Oct 2009 06:21:40 +0000 (23:21 -0700)]
Fix #250, Traceback method name is wrong for exceptions caught in methods

15 years agoFix ticket #215, explicit error for __getslice__, __delslice__ in Py3.
Robert Bradshaw [Fri, 23 Oct 2009 05:39:44 +0000 (22:39 -0700)]
Fix ticket #215, explicit error for __getslice__, __delslice__ in Py3.

15 years agofix in-place division in Py3
Stefan Behnel [Thu, 22 Oct 2009 20:34:15 +0000 (22:34 +0200)]
fix in-place division in Py3

15 years agoAnnotation work.
Robert Bradshaw [Thu, 22 Oct 2009 20:20:11 +0000 (13:20 -0700)]
Annotation work.

15 years agoRemove backwards incompatable change to string identifiers.
Robert Bradshaw [Thu, 22 Oct 2009 19:06:11 +0000 (12:06 -0700)]
Remove backwards incompatable change to string identifiers.