platform/upstream/python-cython.git
10 years agoback up and restore complete exception state around 'finally' clauses; move current...
Stefan Behnel [Tue, 31 Dec 2013 10:02:27 +0000 (11:02 +0100)]
back up and restore complete exception state around 'finally' clauses; move current exception into sys.exc_info in Py3 to match Py3 semantics

10 years agodiscard C code comment from generated code
Stefan Behnel [Tue, 31 Dec 2013 08:09:27 +0000 (09:09 +0100)]
discard C code comment from generated code

10 years agofix refleak on literal/slow tuple creation
Stefan Behnel [Sun, 29 Dec 2013 21:13:17 +0000 (22:13 +0100)]
fix refleak on literal/slow tuple creation

10 years agoMerge pull request #269 from yasuyk/fix-elisp-header-line
scoder [Sun, 29 Dec 2013 12:06:56 +0000 (04:06 -0800)]
Merge pull request #269 from yasuyk/fix-elisp-header-line

Fix file header line for ELPA compatiblility

10 years agoFix header line
Yasuyuki Oka [Sun, 29 Dec 2013 10:36:39 +0000 (19:36 +0900)]
Fix header line

10 years agoRemove experimental flag for C++ class defs.
Robert Bradshaw [Sun, 29 Dec 2013 04:03:22 +0000 (20:03 -0800)]
Remove experimental flag for C++ class defs.

10 years agoextend try-finally tests
Stefan Behnel [Sat, 28 Dec 2013 22:25:38 +0000 (23:25 +0100)]
extend try-finally tests

--HG--
extra : amend_source : c193bf636bba3b0f0439a25f1078e81a065b99fe

10 years agoenable unicode format optimisation for '%' operator regardless of rhs
Stefan Behnel [Sat, 28 Dec 2013 18:12:01 +0000 (19:12 +0100)]
enable unicode format optimisation for '%' operator regardless of rhs

10 years agodisable redundant exception checks for optimised builtins
Stefan Behnel [Sat, 28 Dec 2013 15:18:38 +0000 (16:18 +0100)]
disable redundant exception checks for optimised builtins

10 years agoRelease notes.
Robert Bradshaw [Sat, 28 Dec 2013 00:21:30 +0000 (16:21 -0800)]
Release notes.

10 years agoFix C++ const method declarations.
Robert Bradshaw [Sat, 28 Dec 2013 00:17:17 +0000 (16:17 -0800)]
Fix C++ const method declarations.

10 years agowhitespace
Robert Bradshaw [Sat, 28 Dec 2013 00:16:58 +0000 (16:16 -0800)]
whitespace

10 years agomerge
Stefan Behnel [Fri, 27 Dec 2013 16:22:24 +0000 (17:22 +0100)]
merge

10 years agohandle Py2 compatibility case bytearray.append(pychar)
Stefan Behnel [Fri, 27 Dec 2013 16:12:09 +0000 (17:12 +0100)]
handle Py2 compatibility case bytearray.append(pychar)

--HG--
extra : amend_source : f3b7f004f905c791e6ced2a5b27fffa21f9ceb08

10 years agoMore template parameter deduction.
Robert Bradshaw [Fri, 27 Dec 2013 07:29:26 +0000 (23:29 -0800)]
More template parameter deduction.

10 years agosimple template deduction
Robert Bradshaw [Fri, 27 Dec 2013 07:00:31 +0000 (23:00 -0800)]
simple template deduction

10 years agoFix declaration error test.
Robert Bradshaw [Fri, 27 Dec 2013 01:09:45 +0000 (17:09 -0800)]
Fix declaration error test.

10 years agoAdd function template tests.
Robert Bradshaw [Thu, 26 Dec 2013 23:59:06 +0000 (15:59 -0800)]
Add function template tests.

10 years agoAdd support for external C++ template functions.
Robert Bradshaw [Thu, 26 Dec 2013 23:40:58 +0000 (15:40 -0800)]
Add support for external C++ template functions.

The syntax follows that of template classes, namely

    cdef T foo[T](T, ...)

10 years agoFix C++ complex for clang.
Robert Bradshaw [Thu, 26 Dec 2013 22:41:17 +0000 (14:41 -0800)]
Fix C++ complex for clang.

10 years agoComplex int division not well defined.
Robert Bradshaw [Thu, 26 Dec 2013 21:03:45 +0000 (13:03 -0800)]
Complex int division not well defined.

It's sensitive to compiler implementation.

10 years agoAccept tuple for cythonized extension list.
Robert Bradshaw [Thu, 26 Dec 2013 20:47:51 +0000 (12:47 -0800)]
Accept tuple for cythonized extension list.

10 years agomove C declaration before code
Stefan Behnel [Wed, 25 Dec 2013 16:03:03 +0000 (17:03 +0100)]
move C declaration before code

10 years agofix doctest in Py3
Stefan Behnel [Wed, 25 Dec 2013 13:28:44 +0000 (14:28 +0100)]
fix doctest in Py3

10 years agoadd integer fast-path to __Pyx_PyIndex_AsSsize_t()
Stefan Behnel [Tue, 24 Dec 2013 16:06:04 +0000 (17:06 +0100)]
add integer fast-path to __Pyx_PyIndex_AsSsize_t()

10 years agoinline bytearray.append()
Stefan Behnel [Tue, 24 Dec 2013 15:29:36 +0000 (16:29 +0100)]
inline bytearray.append()

10 years agodisable exception check for special C return type (always assume that it's an excepti...
Stefan Behnel [Tue, 24 Dec 2013 13:56:16 +0000 (14:56 +0100)]
disable exception check for special C return type (always assume that it's an exception when -1 is returned)

--HG--
extra : amend_source : 88f30462a27faf52fcee83af0d1dce714e4f7e69

10 years agooptimise object.append() only when return value is not used and adapt signature accor...
Stefan Behnel [Tue, 24 Dec 2013 13:54:09 +0000 (14:54 +0100)]
optimise object.append() only when return value is not used and adapt signature accordingly

10 years agofix constant folding of PrimaryCmpNode operands
Stefan Behnel [Tue, 24 Dec 2013 12:50:18 +0000 (13:50 +0100)]
fix constant folding of PrimaryCmpNode operands

10 years agofix crash when looking up closure names in OptimizeBuiltinCalls transform (after...
Stefan Behnel [Tue, 24 Dec 2013 07:16:43 +0000 (08:16 +0100)]
fix crash when looking up closure names in OptimizeBuiltinCalls transform (after running CreateClosureClasses transform)

10 years agoavoid redundant NULL inits for extension type fields in tp_new()
Stefan Behnel [Sun, 22 Dec 2013 17:21:18 +0000 (18:21 +0100)]
avoid redundant NULL inits for extension type fields in tp_new()

10 years agomerge 0.19.x branch into master
Stefan Behnel [Sun, 22 Dec 2013 07:44:17 +0000 (08:44 +0100)]
merge 0.19.x branch into master

10 years agofix C compiler warning about unused expression result
Stefan Behnel [Sat, 21 Dec 2013 21:11:42 +0000 (22:11 +0100)]
fix C compiler warning about unused expression result

10 years agofix C compiler warning about unused expression result
Stefan Behnel [Sat, 21 Dec 2013 21:11:42 +0000 (22:11 +0100)]
fix C compiler warning about unused expression result

--HG--
extra : transplant_source : q%D5F8/%0B6%E2%B7R%F3%C9%E1%98%1B%E0X%A0%F1I

10 years agodisable return value saving in finally clauses that only change the GIL status
Stefan Behnel [Thu, 19 Dec 2013 22:31:51 +0000 (23:31 +0100)]
disable return value saving in finally clauses that only change the GIL status

10 years agofix refnanny error output in Py3
Stefan Behnel [Thu, 19 Dec 2013 21:43:12 +0000 (22:43 +0100)]
fix refnanny error output in Py3

10 years agosimplify code
Stefan Behnel [Thu, 19 Dec 2013 19:51:04 +0000 (20:51 +0100)]
simplify code

10 years agofix memoryview warnings
Robert Bradshaw [Thu, 24 Oct 2013 07:23:44 +0000 (00:23 -0700)]
fix memoryview warnings

10 years agofix try-finally-return in functions returning void
Stefan Behnel [Wed, 18 Dec 2013 19:50:54 +0000 (20:50 +0100)]
fix try-finally-return in functions returning void

10 years agofix build
Stefan Behnel [Wed, 18 Dec 2013 18:36:04 +0000 (19:36 +0100)]
fix build

10 years agomerge
Stefan Behnel [Wed, 18 Dec 2013 18:05:38 +0000 (19:05 +0100)]
merge

10 years agoimplement 'yield' inside of 'finally' clause
Stefan Behnel [Wed, 18 Dec 2013 18:02:09 +0000 (19:02 +0100)]
implement 'yield' inside of 'finally' clause

10 years agoDon't warn on un-assigned error types.
Robert Bradshaw [Wed, 18 Dec 2013 09:21:36 +0000 (01:21 -0800)]
Don't warn on un-assigned error types.

10 years agoError for Python objects as C++ class template parameters.
Robert Bradshaw [Wed, 18 Dec 2013 09:18:09 +0000 (01:18 -0800)]
Error for Python objects as C++ class template parameters.

10 years agocreate yield labels purely during code generation instead of counting them upfront
Stefan Behnel [Tue, 17 Dec 2013 16:48:27 +0000 (17:48 +0100)]
create yield labels purely during code generation instead of counting them upfront

10 years agomake intermediate goto-labels more readable by postfixing them with their purpose
Stefan Behnel [Mon, 16 Dec 2013 22:39:29 +0000 (23:39 +0100)]
make intermediate goto-labels more readable by postfixing them with their purpose

10 years agoremove unnecessary code from normal exit case of with-statement
Stefan Behnel [Mon, 16 Dec 2013 22:25:50 +0000 (23:25 +0100)]
remove unnecessary code from normal exit case of with-statement

10 years agostreamline exit code of with-statement
Stefan Behnel [Mon, 16 Dec 2013 22:16:27 +0000 (23:16 +0100)]
streamline exit code of with-statement

10 years agoreduce lifetime of exception tuple in with-statement exception exit case by making...
Stefan Behnel [Mon, 16 Dec 2013 21:38:34 +0000 (22:38 +0100)]
reduce lifetime of exception tuple in with-statement exception exit case by making the WithExitCallNode own it instead of the exception clause

10 years agoreduce code overhead of with-statement a bit by using PyTuple_Pack() for __exit__...
Stefan Behnel [Mon, 16 Dec 2013 21:06:52 +0000 (22:06 +0100)]
reduce code overhead of with-statement a bit by using PyTuple_Pack() for __exit__() arguments

10 years agoimplement Python corner case of passing a tuple as assert message
Stefan Behnel [Mon, 16 Dec 2013 20:54:06 +0000 (21:54 +0100)]
implement Python corner case of passing a tuple as assert message

10 years agoimprove annotation for else-clause in while-loop
Stefan Behnel [Mon, 16 Dec 2013 19:46:36 +0000 (20:46 +0100)]
improve annotation for else-clause in while-loop

10 years agodrop some redundant C labels in if-blocks
Stefan Behnel [Mon, 16 Dec 2013 19:38:34 +0000 (20:38 +0100)]
drop some redundant C labels in if-blocks

--HG--
extra : amend_source : affe6e89d8c2c49654f376fbbda3b1ad29190895

10 years agooptimise list.pop() a little more by splitting it off the generic anyobj.pop() implem...
Stefan Behnel [Mon, 16 Dec 2013 19:16:46 +0000 (20:16 +0100)]
optimise list.pop() a little more by splitting it off the generic anyobj.pop() implementation

10 years agoadd and improve some more may_be_none() methods
Stefan Behnel [Mon, 16 Dec 2013 18:34:39 +0000 (19:34 +0100)]
add and improve some more may_be_none() methods

10 years agofix typo
Stefan Behnel [Mon, 16 Dec 2013 18:09:54 +0000 (19:09 +0100)]
fix typo

10 years agomake CallNode a little smarter about when the return value can be None
Stefan Behnel [Mon, 16 Dec 2013 18:08:53 +0000 (19:08 +0100)]
make CallNode a little smarter about when the return value can be None

10 years agolet SliceNode know it returns a slice instance
Stefan Behnel [Mon, 16 Dec 2013 17:55:54 +0000 (18:55 +0100)]
let SliceNode know it returns a slice instance

10 years agobe a bit smarter about when slicing or item access return None
Stefan Behnel [Mon, 16 Dec 2013 17:39:53 +0000 (18:39 +0100)]
be a bit smarter about when slicing or item access return None

--HG--
extra : amend_source : 51a4e6ec35c70af746630fcada3982c2decde872

10 years agofix compiler crash
Stefan Behnel [Sun, 15 Dec 2013 09:20:58 +0000 (10:20 +0100)]
fix compiler crash

10 years agomake sure the optimised try-finally always generates code for the original finally...
Stefan Behnel [Sat, 14 Dec 2013 20:15:45 +0000 (21:15 +0100)]
make sure the optimised try-finally always generates code for the original finally block subtree (just in case it references something external)

10 years agofix typo
Stefan Behnel [Sat, 14 Dec 2013 19:57:01 +0000 (20:57 +0100)]
fix typo

10 years agodiscard else clause from try-except statements that do not terminate normally
Stefan Behnel [Sat, 14 Dec 2013 19:39:37 +0000 (20:39 +0100)]
discard else clause from try-except statements that do not terminate normally

10 years agofix C compiler warning about unused variable
Stefan Behnel [Sat, 14 Dec 2013 19:25:21 +0000 (20:25 +0100)]
fix C compiler warning about unused variable

10 years agoextend test
Stefan Behnel [Sat, 14 Dec 2013 19:11:46 +0000 (20:11 +0100)]
extend test

10 years agochangelog
Stefan Behnel [Sat, 14 Dec 2013 19:11:38 +0000 (20:11 +0100)]
changelog

10 years agogenerate separate C code branches for each exit case of a try-finally statement
Stefan Behnel [Sat, 14 Dec 2013 19:11:02 +0000 (20:11 +0100)]
generate separate C code branches for each exit case of a try-finally statement

10 years agominor code cleanup
Stefan Behnel [Sat, 14 Dec 2013 16:29:37 +0000 (17:29 +0100)]
minor code cleanup

--HG--
extra : amend_source : c948151354a77be026c92d57abc151e51fb271c6

10 years agomark node position in C file when starting to generate the node's code, not that...
Stefan Behnel [Sat, 14 Dec 2013 15:58:10 +0000 (16:58 +0100)]
mark node position in C file when starting to generate the node's code, not that of the subexpressions

--HG--
extra : amend_source : 566ce3ed6bd0efbb075126a6c5823b773c72d2ea

10 years agoset constant_result of empty containers created in ConstantFolding transform
Stefan Behnel [Sat, 14 Dec 2013 13:26:12 +0000 (14:26 +0100)]
set constant_result of empty containers created in ConstantFolding transform

10 years agofix constant folding with false partial result
Stefan Behnel [Sat, 14 Dec 2013 11:05:36 +0000 (12:05 +0100)]
fix constant folding with false partial result

10 years agoundo the Python-optimisationism of assigning bound/unbound methods to local variables...
Stefan Behnel [Sat, 14 Dec 2013 10:59:47 +0000 (11:59 +0100)]
undo the Python-optimisationism of assigning bound/unbound methods to local variables when Cython can call a builtin C function instead

--HG--
extra : amend_source : 121eadd540f25f9e43f6e6b60853eeab18d11620

10 years agoremove redundant code
Stefan Behnel [Fri, 13 Dec 2013 20:37:08 +0000 (21:37 +0100)]
remove redundant code

10 years agosimplify constant folded comparison code a little and extend the test for it
Stefan Behnel [Fri, 13 Dec 2013 20:31:26 +0000 (21:31 +0100)]
simplify constant folded comparison code a little and extend the test for it

10 years agoundo accidental commit
Stefan Behnel [Fri, 13 Dec 2013 19:34:17 +0000 (20:34 +0100)]
undo accidental commit

10 years agofix tracing again
Stefan Behnel [Fri, 13 Dec 2013 19:31:29 +0000 (20:31 +0100)]
fix tracing again

10 years agofix tracing in recent Py3.4
Stefan Behnel [Fri, 13 Dec 2013 13:41:00 +0000 (14:41 +0100)]
fix tracing in recent Py3.4

10 years agolet RemoveUnreachableCode discard any PassStatNodes (e.g. added by analysing declarat...
Stefan Behnel [Thu, 12 Dec 2013 18:38:04 +0000 (19:38 +0100)]
let RemoveUnreachableCode discard any PassStatNodes (e.g. added by analysing declaration-only ExprStatNode)

10 years agofix C compiler warning about unused utility code
Stefan Behnel [Thu, 12 Dec 2013 17:17:33 +0000 (18:17 +0100)]
fix C compiler warning about unused utility code

--HG--
extra : rebase_source : 2e86ee2423754e0cfa6e79b33b9570a25a019c01

10 years agoUse makedirs rather than mkdir for cache location.
Robert Bradshaw [Thu, 12 Dec 2013 05:40:09 +0000 (21:40 -0800)]
Use makedirs rather than mkdir for cache location.

10 years agoUse default location ~/.cycache when cython cache is set to True.
Robert Bradshaw [Thu, 12 Dec 2013 05:33:04 +0000 (21:33 -0800)]
Use default location ~/.cycache when cython cache is set to True.

10 years agominor code cleanup
Stefan Behnel [Wed, 11 Dec 2013 21:39:48 +0000 (22:39 +0100)]
minor code cleanup

10 years agoclean up IntNode() instantiation
Stefan Behnel [Wed, 11 Dec 2013 21:35:24 +0000 (22:35 +0100)]
clean up IntNode() instantiation

10 years agominor portability tweak: mark non-tiny integer literals as C longs with "L" suffix...
Stefan Behnel [Wed, 11 Dec 2013 21:12:55 +0000 (22:12 +0100)]
minor portability tweak: mark non-tiny integer literals as C longs with "L" suffix when passing them into PyInt_FromLong()

10 years agotweak order of constant generation a bit
Stefan Behnel [Wed, 11 Dec 2013 21:00:54 +0000 (22:00 +0100)]
tweak order of constant generation a bit

10 years agoremove some code redundancy
Stefan Behnel [Wed, 11 Dec 2013 20:56:03 +0000 (21:56 +0100)]
remove some code redundancy

10 years agoremove some unused code
Stefan Behnel [Wed, 11 Dec 2013 20:45:11 +0000 (21:45 +0100)]
remove some unused code

10 years agoavoid accidental duplication of cached Python integer constants when using numbers...
Stefan Behnel [Wed, 11 Dec 2013 20:41:10 +0000 (21:41 +0100)]
avoid accidental duplication of cached Python integer constants when using numbers in different notations

10 years agofix syntax copy&pastos
Stefan Behnel [Wed, 11 Dec 2013 18:38:49 +0000 (19:38 +0100)]
fix syntax copy&pastos

10 years agofix C compiler warnings about unused variables in tests
Stefan Behnel [Wed, 11 Dec 2013 18:16:20 +0000 (19:16 +0100)]
fix C compiler warnings about unused variables in tests

10 years agotry fixing test failures in int_literals.pyx by removing dependency on Py2/3 specific...
Stefan Behnel [Wed, 11 Dec 2013 18:02:23 +0000 (19:02 +0100)]
try fixing test failures in int_literals.pyx by removing dependency on Py2/3 specific 'L' postfix of long objects

10 years agoremove unnecessary complication from test
Stefan Behnel [Wed, 11 Dec 2013 07:20:09 +0000 (08:20 +0100)]
remove unnecessary complication from test

10 years agouse normal constant calculation for special case to avoid inconsistencies
Stefan Behnel [Tue, 10 Dec 2013 20:00:10 +0000 (21:00 +0100)]
use normal constant calculation for special case to avoid inconsistencies

10 years agorewrite constant folding for PrimaryCmpNode to properly support (and fix) cascaded...
Stefan Behnel [Tue, 10 Dec 2013 19:52:02 +0000 (20:52 +0100)]
rewrite constant folding for PrimaryCmpNode to properly support (and fix) cascaded comparisons

10 years agoremove outdated comment
Stefan Behnel [Mon, 9 Dec 2013 07:38:53 +0000 (08:38 +0100)]
remove outdated comment

10 years agofix test after making constant folding remove unused constants
Stefan Behnel [Sun, 8 Dec 2013 14:16:49 +0000 (15:16 +0100)]
fix test after making constant folding remove unused constants

10 years agofix compiler crash
Stefan Behnel [Sun, 8 Dec 2013 14:12:55 +0000 (15:12 +0100)]
fix compiler crash

10 years agodiscard lots of useless code and overhead from try-finally statements that don't...
Stefan Behnel [Sun, 8 Dec 2013 13:51:43 +0000 (14:51 +0100)]
discard lots of useless code and overhead from try-finally statements that don't need to handle Python exceptions (including C-only with-blocks)

10 years agoadd test for empty try-finally
Stefan Behnel [Sun, 8 Dec 2013 11:49:46 +0000 (12:49 +0100)]
add test for empty try-finally

10 years agofix Py2.4 C compilation problem
Stefan Behnel [Sun, 8 Dec 2013 11:25:50 +0000 (12:25 +0100)]
fix Py2.4 C compilation problem