platform/upstream/python-cython.git
10 years agostrip mult-factor from empty list literals
Stefan Behnel [Sun, 1 Dec 2013 15:10:01 +0000 (16:10 +0100)]
strip mult-factor from empty list literals

10 years agopre-calculate constant loop length when iterating over literal tuples/lists
Stefan Behnel [Sun, 1 Dec 2013 15:02:57 +0000 (16:02 +0100)]
pre-calculate constant loop length when iterating over literal tuples/lists

10 years agodiscard constant True condition in while loops
Stefan Behnel [Sun, 1 Dec 2013 14:37:05 +0000 (15:37 +0100)]
discard constant True condition in while loops

10 years agoget rid of 'yellow last line' problem by assigning the function exit error handling...
Stefan Behnel [Sun, 1 Dec 2013 08:19:03 +0000 (09:19 +0100)]
get rid of 'yellow last line' problem by assigning the function exit error handling and default value return code to the signature line instead of the last code line

10 years agofix annotation for generated Python function wrapper
Stefan Behnel [Sun, 1 Dec 2013 07:59:47 +0000 (08:59 +0100)]
fix annotation for generated Python function wrapper

10 years agofix annotation score calculation
Stefan Behnel [Sun, 1 Dec 2013 07:56:06 +0000 (08:56 +0100)]
fix annotation score calculation

10 years agofix copy&past bug
Stefan Behnel [Sat, 30 Nov 2013 20:07:38 +0000 (21:07 +0100)]
fix copy&past bug

10 years agoclean up some code
Stefan Behnel [Sat, 30 Nov 2013 19:58:35 +0000 (20:58 +0100)]
clean up some code

10 years agoparse and annotate the C code in one pass instead of repeated parse+replace operations
Stefan Behnel [Sat, 30 Nov 2013 19:22:57 +0000 (20:22 +0100)]
parse and annotate the C code in one pass instead of repeated parse+replace operations

10 years agominor code cleanup
Stefan Behnel [Sat, 30 Nov 2013 14:47:31 +0000 (15:47 +0100)]
minor code cleanup

10 years agofix annotation of modules that do not generate any C code for user sources
Stefan Behnel [Sat, 30 Nov 2013 14:41:21 +0000 (15:41 +0100)]
fix annotation of modules that do not generate any C code for user sources

10 years agofix embedsignatures test in Py3.4
Stefan Behnel [Fri, 29 Nov 2013 15:40:04 +0000 (16:40 +0100)]
fix embedsignatures test in Py3.4

10 years agofix doctest in Py3.4
Stefan Behnel [Fri, 29 Nov 2013 15:17:24 +0000 (16:17 +0100)]
fix doctest in Py3.4

10 years agofix doctest in Py3.4
Stefan Behnel [Fri, 29 Nov 2013 15:14:22 +0000 (16:14 +0100)]
fix doctest in Py3.4

10 years agodisable autotestdict when testing under Py3.4 and adapt autotestdict tests to make...
Stefan Behnel [Fri, 29 Nov 2013 12:58:40 +0000 (13:58 +0100)]
disable autotestdict when testing under Py3.4 and adapt autotestdict tests to make up for its smarter docstring lookup

10 years agofix caching of e+nnn format floats
Stefan Behnel [Mon, 25 Nov 2013 18:48:46 +0000 (19:48 +0100)]
fix caching of e+nnn format floats

10 years agominor safety fixes in constant folding
Stefan Behnel [Sun, 24 Nov 2013 15:54:43 +0000 (16:54 +0100)]
minor safety fixes in constant folding

10 years agochangelog
Stefan Behnel [Sun, 24 Nov 2013 15:41:23 +0000 (16:41 +0100)]
changelog

10 years agominor code cleanup
Stefan Behnel [Sun, 24 Nov 2013 15:29:40 +0000 (16:29 +0100)]
minor code cleanup

10 years agofix compiler crash on unitialised result_code and fix coercion of float/bool back...
Stefan Behnel [Sun, 24 Nov 2013 15:20:39 +0000 (16:20 +0100)]
fix compiler crash on unitialised result_code and fix coercion of float/bool back to C values

10 years agouse plain constants for Python bool values instead of coerced C ints
Stefan Behnel [Sun, 24 Nov 2013 15:06:46 +0000 (16:06 +0100)]
use plain constants for Python bool values instead of coerced C ints

10 years agoextend test
Stefan Behnel [Sun, 24 Nov 2013 14:42:39 +0000 (15:42 +0100)]
extend test

10 years agocache Python float constants
Stefan Behnel [Sun, 24 Nov 2013 13:32:45 +0000 (14:32 +0100)]
cache Python float constants

--HG--
extra : amend_source : a382ac055ce79771e0457bed2e3b8d253581a54f

10 years agostreamline iteration termination a bit
Stefan Behnel [Sun, 24 Nov 2013 12:18:12 +0000 (13:18 +0100)]
streamline iteration termination a bit

10 years agolet += and -= inplace operators use pointer arithmetic when used on C strings (instea...
Stefan Behnel [Sat, 23 Nov 2013 20:59:15 +0000 (21:59 +0100)]
let += and -= inplace operators use pointer arithmetic when used on C strings (instead of currently failing attempt at string concatenation)

10 years agominor code cleanup
Stefan Behnel [Sat, 23 Nov 2013 20:44:31 +0000 (21:44 +0100)]
minor code cleanup

10 years agoremove outdated test
Stefan Behnel [Sat, 23 Nov 2013 20:37:41 +0000 (21:37 +0100)]
remove outdated test

10 years agomake some tests from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:34:34 +0000 (21:34 +0100)]
make some tests from 'broken' directory usable

--HG--
rename : tests/broken/inplace_lhs.pyx => tests/compile/inplace_lhs.pyx
rename : tests/broken/inplace_ops.pyx => tests/compile/inplace_ops.pyx

10 years agomake an old test from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:26:19 +0000 (21:26 +0100)]
make an old test from 'broken' directory usable

--HG--
rename : tests/broken/voidstarcast.pyx => tests/run/voidstarcast.pyx

10 years agomake an old test from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:22:15 +0000 (21:22 +0100)]
make an old test from 'broken' directory usable

10 years agomake an old test from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:21:44 +0000 (21:21 +0100)]
make an old test from 'broken' directory usable

--HG--
rename : tests/broken/typeofexttype.pyx => tests/run/typeofexttype.pyx

10 years agomake an old test from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:15:13 +0000 (21:15 +0100)]
make an old test from 'broken' directory usable

10 years agoremove some useless tests from 'broken' directory
Stefan Behnel [Sat, 23 Nov 2013 20:09:53 +0000 (21:09 +0100)]
remove some useless tests from 'broken' directory

10 years agomake an old test from 'broken' directory usable
Stefan Behnel [Sat, 23 Nov 2013 20:09:24 +0000 (21:09 +0100)]
make an old test from 'broken' directory usable

--HG--
rename : tests/broken/onelinesuite.pyx => tests/run/onelinesuite.py

10 years agoextend test
Stefan Behnel [Sat, 23 Nov 2013 20:01:21 +0000 (21:01 +0100)]
extend test

10 years agounpack redundantly coerced int/float literals during optimisation cleanup
Stefan Behnel [Sat, 23 Nov 2013 19:58:10 +0000 (20:58 +0100)]
unpack redundantly coerced int/float literals during optimisation cleanup

10 years agoextend test
Stefan Behnel [Sat, 23 Nov 2013 19:45:54 +0000 (20:45 +0100)]
extend test

10 years agominor code cleanup
Stefan Behnel [Sat, 23 Nov 2013 19:42:33 +0000 (20:42 +0100)]
minor code cleanup

10 years agofix no-args int() call
Stefan Behnel [Sat, 23 Nov 2013 19:25:08 +0000 (20:25 +0100)]
fix no-args int() call

10 years agocall PyNumber_Int() for builtin int() function
Stefan Behnel [Sat, 23 Nov 2013 16:28:44 +0000 (17:28 +0100)]
call PyNumber_Int() for builtin int() function

10 years agoextend test
Stefan Behnel [Sat, 23 Nov 2013 14:39:17 +0000 (15:39 +0100)]
extend test

10 years agomerge 0.19.x branch into master
Stefan Behnel [Sat, 23 Nov 2013 13:14:45 +0000 (14:14 +0100)]
merge 0.19.x branch into master

10 years agofix 'raise type, instance' in Py3 by preventing it from trying to re-instantiate...
Stefan Behnel [Sat, 23 Nov 2013 13:13:29 +0000 (14:13 +0100)]
fix 'raise type, instance' in Py3 by preventing it from trying to re-instantiate the instance

10 years agoextend test
Stefan Behnel [Sat, 23 Nov 2013 11:48:20 +0000 (12:48 +0100)]
extend test

10 years agoback out the last two exception raising changes
Stefan Behnel [Sat, 23 Nov 2013 10:30:19 +0000 (11:30 +0100)]
back out the last two exception raising changes

10 years agomerge 0.19.x branch into master
Stefan Behnel [Sat, 23 Nov 2013 10:21:23 +0000 (11:21 +0100)]
merge 0.19.x branch into master

10 years agofix refcounting in __Pyx_Raise() because PyErr_NormalizeException() increfs its retur...
Stefan Behnel [Sat, 23 Nov 2013 10:21:00 +0000 (11:21 +0100)]
fix refcounting in __Pyx_Raise() because PyErr_NormalizeException() increfs its return values

10 years agoavoid executing Python doctest that doesn't work in Py2.x
Stefan Behnel [Sat, 23 Nov 2013 07:59:47 +0000 (08:59 +0100)]
avoid executing Python doctest that doesn't work in Py2.x

--HG--
rename : tests/run/pyclass_special_methods.py => tests/run/pyclass_special_methods.pyx

10 years agomerge 0.19.x branch into master
Stefan Behnel [Sat, 23 Nov 2013 07:50:43 +0000 (08:50 +0100)]
merge 0.19.x branch into master

10 years agolet CPython do the exception instantiation on 'raise' in Py3 to make sure we handle...
Stefan Behnel [Sat, 23 Nov 2013 07:50:14 +0000 (08:50 +0100)]
let CPython do the exception instantiation on 'raise' in Py3 to make sure we handle all special cases correctly

10 years agouse more CPython-like (and potentially faster) _PyType_Lookup() for internal special...
Stefan Behnel [Fri, 22 Nov 2013 18:48:18 +0000 (19:48 +0100)]
use more CPython-like (and potentially faster) _PyType_Lookup() for internal special method lookups instead of generic attribute lookup

10 years agoalways wrap for-iterator node in NextNode after analysing it (might have been replaced)
Stefan Behnel [Fri, 22 Nov 2013 06:48:00 +0000 (07:48 +0100)]
always wrap for-iterator node in NextNode after analysing it (might have been replaced)

10 years agorevert incomplete fix for ticket #600: not enough for more complex scoping and evalua...
Stefan Behnel [Fri, 22 Nov 2013 06:45:25 +0000 (07:45 +0100)]
revert incomplete fix for ticket #600: not enough for more complex scoping and evaluation time issues

10 years agomake sure foreign entries are reused
Stefan Behnel [Fri, 22 Nov 2013 06:39:11 +0000 (07:39 +0100)]
make sure foreign entries are reused

10 years agoextend test
Stefan Behnel [Fri, 22 Nov 2013 06:38:25 +0000 (07:38 +0100)]
extend test

10 years agoalways wrap for-iterator node in NextNode after analysing it (might have been replaced)
Stefan Behnel [Fri, 22 Nov 2013 05:31:49 +0000 (06:31 +0100)]
always wrap for-iterator node in NextNode after analysing it (might have been replaced)

10 years agoextend test
Stefan Behnel [Fri, 22 Nov 2013 05:08:23 +0000 (06:08 +0100)]
extend test

10 years agoremove some references to old "build_ext" building way in cygdb docs
Stefan Behnel [Wed, 20 Nov 2013 06:23:05 +0000 (07:23 +0100)]
remove some references to old "build_ext" building way in cygdb docs

10 years agofix T600: lookup of iterables in genexpr must use outer scope
Stefan Behnel [Sun, 17 Nov 2013 11:40:19 +0000 (12:40 +0100)]
fix T600: lookup of iterables in genexpr must use outer scope

10 years agoreenable some tests
Stefan Behnel [Sun, 17 Nov 2013 11:13:47 +0000 (12:13 +0100)]
reenable some tests

10 years agomove old list test from broken into tests/compile/
Stefan Behnel [Sun, 17 Nov 2013 11:02:36 +0000 (12:02 +0100)]
move old list test from broken into tests/compile/

--HG--
rename : tests/broken/builtinlist.pyx => tests/compile/builtinlist.pyx
extra : amend_source : 9d1f1806562a676bb13d2fe5472d5a9261fb3b18

10 years agofix test
Stefan Behnel [Sun, 17 Nov 2013 10:59:35 +0000 (11:59 +0100)]
fix test

10 years agomove old list test from broken into list.pyx
Stefan Behnel [Sun, 17 Nov 2013 10:59:19 +0000 (11:59 +0100)]
move old list test from broken into list.pyx

10 years agocomment
Stefan Behnel [Sun, 17 Nov 2013 09:03:34 +0000 (10:03 +0100)]
comment

10 years agoremove useless return in __init__()
Stefan Behnel [Sun, 17 Nov 2013 08:57:32 +0000 (09:57 +0100)]
remove useless return in __init__()

10 years agoimprove some class comments
Stefan Behnel [Sat, 16 Nov 2013 20:58:35 +0000 (21:58 +0100)]
improve some class comments

10 years agomove qualname calculation transform a little later in the pipeline
Stefan Behnel [Sat, 16 Nov 2013 07:22:42 +0000 (08:22 +0100)]
move qualname calculation transform a little later in the pipeline

10 years agofix tree traversal for FusedCFuncDefNode
Stefan Behnel [Sat, 16 Nov 2013 07:22:09 +0000 (08:22 +0100)]
fix tree traversal for FusedCFuncDefNode

10 years agofix qualname calculation crash for c(p)def functions/classes
Stefan Behnel [Fri, 15 Nov 2013 21:30:28 +0000 (22:30 +0100)]
fix qualname calculation crash for c(p)def functions/classes

10 years agomove PEP 3155 qualname tests into separate test module
Stefan Behnel [Fri, 15 Nov 2013 20:47:03 +0000 (21:47 +0100)]
move PEP 3155 qualname tests into separate test module

--HG--
rename : tests/run/cyfunction.pyx => tests/run/qualname.pyx

10 years agomerge
Stefan Behnel [Fri, 15 Nov 2013 20:41:12 +0000 (21:41 +0100)]
merge

10 years agoreimplement PEP 3155 __qualname__ calculation in a dedicated transform to base it...
Stefan Behnel [Fri, 15 Nov 2013 20:38:45 +0000 (21:38 +0100)]
reimplement PEP 3155 __qualname__ calculation in a dedicated transform to base it on the node structure instead of the scopes (which fails for class scopes)

10 years agoMerge pull request #268 from andreabedini/master
scoder [Mon, 11 Nov 2013 11:15:12 +0000 (03:15 -0800)]
Merge pull request #268 from andreabedini/master

Fix npy_bool signedness

10 years agoFix npy_bool signedness
Andrea Bedini [Mon, 11 Nov 2013 08:29:59 +0000 (19:29 +1100)]
Fix npy_bool signedness

From numpy's definition in

https://github.com/numpy/numpy/blob/master/numpy/core/include/numpy/npy_common.h#L211

```typedef unsigned char npy_bool;```

10 years agoavoid pessimisation when int-indexing into dicts
Stefan Behnel [Sun, 10 Nov 2013 18:12:24 +0000 (19:12 +0100)]
avoid pessimisation when int-indexing into dicts

10 years agofix C compiler warning in Py2.4
Stefan Behnel [Sun, 10 Nov 2013 15:59:40 +0000 (16:59 +0100)]
fix C compiler warning in Py2.4

10 years agoinline PyUnicode_Compare() function for equality comparisons
Stefan Behnel [Sun, 10 Nov 2013 15:54:05 +0000 (16:54 +0100)]
inline PyUnicode_Compare() function for equality comparisons

10 years agooptimise string equality comparison by always looking at the first character before...
Stefan Behnel [Sun, 10 Nov 2013 14:52:48 +0000 (15:52 +0100)]
optimise string equality comparison by always looking at the first character before calling into the C-API

--HG--
extra : amend_source : 65f946184bc3b291289c54f6787aba7d2ad43b20

10 years agoavoid useless lookup of unknown encoding (fixes compiler crash)
Stefan Behnel [Sun, 3 Nov 2013 17:18:02 +0000 (18:18 +0100)]
avoid useless lookup of unknown encoding (fixes compiler crash)

--HG--
extra : transplant_source : %D5%D9Izb%7F%E6%AF%91%9A2j%25%FC%27%85%7CFs5

10 years agoadd regression test for non-optimised unicode.encode() calls
Stefan Behnel [Sun, 3 Nov 2013 17:30:31 +0000 (18:30 +0100)]
add regression test for non-optimised unicode.encode() calls

10 years agofix ref-leak during Py2-style class instantiation
Stefan Behnel [Fri, 1 Nov 2013 10:30:45 +0000 (11:30 +0100)]
fix ref-leak during Py2-style class instantiation

10 years agoimplement metaclass calculation/validation algorithm, make classes inherit their...
Stefan Behnel [Sun, 27 Oct 2013 14:53:43 +0000 (15:53 +0100)]
implement metaclass calculation/validation algorithm, make classes inherit their parents' metaclass

10 years agoimplement minor special case of indexing into an inferred 1-char Unicode string
Stefan Behnel [Sat, 9 Nov 2013 13:57:57 +0000 (14:57 +0100)]
implement minor special case of indexing into an inferred 1-char Unicode string

--HG--
extra : amend_source : 068dca3eae20906b495571f1d80548dc5f99ed51

10 years agofix utility function signature
Stefan Behnel [Sat, 9 Nov 2013 08:38:56 +0000 (09:38 +0100)]
fix utility function signature

10 years agowork around stupid C compiler warnings about tests being always true due to integer...
Stefan Behnel [Sat, 9 Nov 2013 08:24:13 +0000 (09:24 +0100)]
work around stupid C compiler warnings about tests being always true due to integer ranges

10 years agoC++ compilation fix
Stefan Behnel [Sat, 9 Nov 2013 07:54:46 +0000 (08:54 +0100)]
C++ compilation fix

10 years agoadd another straight exception case to macros
Stefan Behnel [Sat, 9 Nov 2013 07:45:04 +0000 (08:45 +0100)]
add another straight exception case to macros

10 years agofix C compiler warning in overflow tests
Stefan Behnel [Sat, 9 Nov 2013 07:10:37 +0000 (08:10 +0100)]
fix C compiler warning in overflow tests

10 years agoreplace some redundant utility functions by explicit exceptions
Stefan Behnel [Sat, 9 Nov 2013 07:04:29 +0000 (08:04 +0100)]
replace some redundant utility functions by explicit exceptions

10 years agomake fast path in Get/SetItemInt() utility functions safe for sizeof(index type)...
Stefan Behnel [Sat, 9 Nov 2013 06:48:42 +0000 (07:48 +0100)]
make fast path in Get/SetItemInt() utility functions safe for sizeof(index type) >= sizeof(Py_ssize_t)

10 years agofix copy&paste code in __Pyx_SetItemInt_ByteArray_Generic()
Stefan Behnel [Fri, 8 Nov 2013 13:40:02 +0000 (14:40 +0100)]
fix copy&paste code in __Pyx_SetItemInt_ByteArray_Generic()

10 years agoclean up some code redundancy
Stefan Behnel [Fri, 8 Nov 2013 12:39:20 +0000 (13:39 +0100)]
clean up some code redundancy

10 years agoadd value range check for C level assignments to bytearray indices in order to mimic...
Stefan Behnel [Fri, 8 Nov 2013 12:06:55 +0000 (13:06 +0100)]
add value range check for C level assignments to bytearray indices in order to mimic the safe Python behaviour

10 years agofix test
Stefan Behnel [Thu, 7 Nov 2013 10:07:58 +0000 (11:07 +0100)]
fix test

10 years agofix test in older Py3.x versions, minor cleanups
Stefan Behnel [Thu, 7 Nov 2013 09:09:45 +0000 (10:09 +0100)]
fix test in older Py3.x versions, minor cleanups

10 years agosupport 'global' in Python class body
Stefan Behnel [Thu, 7 Nov 2013 07:13:35 +0000 (08:13 +0100)]
support 'global' in Python class body

--HG--
rename : tests/run/ass2global.pyx => tests/run/ass2global.py

10 years agofix "__qualname__" of names defined as 'global'
Stefan Behnel [Thu, 7 Nov 2013 07:06:53 +0000 (08:06 +0100)]
fix "__qualname__" of names defined as 'global'

10 years agosupport bytearray as auto encoding string type
Stefan Behnel [Wed, 6 Nov 2013 06:36:03 +0000 (07:36 +0100)]
support bytearray as auto encoding string type

--HG--
rename : tests/run/str_ascii_auto_encoding.pyx => tests/run/bytearray_ascii_auto_encoding.pyx
rename : tests/run/str_default_auto_encoding.pyx => tests/run/bytearray_default_auto_encoding.pyx

10 years agoadd note to fused types docs that they are not supported for attributes of extension...
Stefan Behnel [Wed, 6 Nov 2013 05:34:59 +0000 (06:34 +0100)]
add note to fused types docs that they are not supported for attributes of extension types

10 years agoimplement (and thus, fix) index assignments to bytearray objects
Stefan Behnel [Tue, 5 Nov 2013 20:00:57 +0000 (21:00 +0100)]
implement (and thus, fix) index assignments to bytearray objects