summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
Commit message (Collapse)AuthorAgeFilesLines
* Drop unused code-paths associated with "if cython.compiled" early (GH-3507)da-woods2020-04-131-3/+14
| | | | | | | | | | | | | This allows things to work like: # in pxd file from libc.math cimport sin # in py file if not cython.compiled: from math import sin # previously failed with cython compile # error because it was assigning to a cdef name This seems worthwhile because it makes it easier to write code that re-assigns cdef names and so works in both modes.
* Specialize fused function local variables specified with pure-python (GH-3463)da-woods2020-03-311-0/+2
| | | | | | | These were previously getting missed. Added code to specialize them and tests to prove it. Fixes https://github.com/cython/cython/issues/3142 Also fixes https://github.com/cython/cython/issues/3460 - (seems related enough to go in the same PR)
* Merge branch '0.29.x'Stefan Behnel2020-02-121-0/+2
|\
| * fix "undeclared" warning about generated pickle methods (GH-3353)da-woods2020-02-121-0/+2
| | | | | | | | | | The pickle functions __reduce__ and __setstate_cython__ were being visited in the module scope (where they were undeclared) rather than the class scope where they were declared
| * Mangle cname for closures in derived c class (GH-2990)Josh Tobin2019-06-111-1/+4
| |
* | Support METH_FASTCALL for Cython functions (GH-3101)Jeroen Demeyer2019-09-101-3/+0
| |
* | Rename self_result_code -> closure_result_codeJeroen Demeyer2019-08-271-1/+1
| |
* | Use METH_FASTCALL on CPython >= 3.7 (GH-3021)Jeroen Demeyer2019-08-271-0/+5
| |
* | Support wider use of @property decorator on CClassDef AttributeNodes (GH-3095)Matti Picus2019-08-271-1/+3
| | | | | | | | | | | | * TEST: add cgetter test for pointer and pxd use * BUG: handle more AttributeNode-with-property-decorator * BUG: fix numpy/__init__.pxd * ENH: add @property for ndarray.size, formatting cleanup
* | Unicode identifiers (PEP 3131) (GH-3081)da-woods2019-08-241-4/+5
| | | | | | Closes #2601
* | Mangle cname for closures in derived c class (GH-2990)Josh Tobin2019-06-111-1/+4
| |
* | Merge branch '0.29.x'Stefan Behnel2019-03-041-1/+2
|\ \ | |/
| * Add missing return type annotation to generators and coroutines.Stefan Behnel2019-03-041-1/+2
| | | | | | | | Closes GH-2884.
* | Create run tests for conditional GILStatNodeNoam Hershtig2019-02-231-2/+10
| |
* | Allow condition in GILStatNodeNoam Hershtig2019-02-231-0/+5
| |
* | Only inject eval() locals/globals args when it's called as a builtin and not ↵Stefan Behnel2019-02-031-2/+2
| | | | | | | | redefined e.g. in the module (found when updating test_grammar() and overriding it there).
* | Merge pull request #2640 from mattip/ctypedef-class-getter2Stefan Behnel2019-01-161-1/+24
|\ \ | | | | | | ENH: allow @property decorator on external ctypedef classes
| * | MAINT: refactor decorator analysismattip2019-01-071-16/+17
| | |
| * | MAINT: refactor: is_cgetter now lives on the entry, use find_decoratormattip2019-01-071-13/+11
| | |
| * | MAINT: refactor from reviewmattip2019-01-051-11/+16
| | |
| * | whoops, staticmethod is a valid cdef decoratormattip2018-11-131-0/+1
| | |
| * | ENH: handle c-level property decorator to produce a cfunc callmattip2018-11-131-9/+8
| | |
| * | add a new ReplacePropertyNode passmattip2018-11-131-61/+19
| | |
| * | WIP ENH: allow @property decorator on external ctypedef classesmattip2018-11-051-1/+62
| |/
* | Use Py3 syntax in generated Cython code fragment.Stefan Behnel2019-01-121-1/+1
| |
* | Replace MD5 file hashing by SHA-1, both because it's faster (by 25% on 64 ↵Stefan Behnel2019-01-081-1/+1
|/ | | | | | bit Linux) and because MD5 is no longer allowed in US FIPS 140-2 environments. Closes #2790.
* 2685_warn_undeclared: fix undeclared type warnings for unpickle variables.Nicolas Pauss2018-10-301-0/+4
| | | | | | | | | | The types of variables __pyx_PickleError, __pyx_result from generated unpickle function, and variables state, _dict from __reduce_cython__ generated method were not declared. So warnings were raised with warn.undeclared for every single extension type. Now, we define the type of these variables, and no warnings are raised.
* Prevent assigned global variables from being marked and treated as closure ↵Stefan Behnel2018-09-221-1/+1
| | | | | | variables in generators and coroutines. Closes #2613.
* Clean up directives to distinguish between those that belong to a function ↵Stefan Behnel2018-09-221-32/+29
| | | | | | | or class and those that are generally inherited. Everything that is not inherited should also not have a default value and instead exist or not. Then, prevent lambdas and generator expressions from inheriting directives from their outer function/scope, e.g. "@cython.cdef". Closes #459.
* Check some child nodes against the correct nogil context when they are ↵Stefan Behnel2018-09-191-12/+24
| | | | actually being evaluated in the outer scope (e.g default arguments or annotations of a nogil function).
* Support "@cython.nogil" decorator in pure mode.Stefan Behnel2018-09-141-2/+7
| | | | Closes #2557.
* Mark try-finally statements with terminating finally clauses as terminators ↵Stefan Behnel2018-08-251-0/+6
| | | | themselves.
* Simplify code to format it better.Stefan Behnel2018-07-231-2/+2
|
* Pythran: verify that pythran supports called Numpy APIsAdrien Guinet2018-07-211-1/+2
|
* Add some comments on potential improvements.Stefan Behnel2018-06-041-0/+4
|
* Improve a docstring.Stefan Behnel2018-06-031-1/+4
|
* Make raise-statements inside of nogil blocks automatically acquire the GIL, ↵Stefan Behnel2018-06-031-0/+47
| | | | instead of requiring an explicit ``with gil`` block around them.
* Delete unused code.Stefan Behnel2018-05-101-14/+1
|
* Do not hijack "@asyncio.coroutine" to make async-def functions iterable, ↵Stefan Behnel2018-02-281-16/+2
| | | | since this is really just a legacy feature that users should not overuse. Instead, provide a dedicated and explicit "cython.iterable_coroutine" directive.
* Allow @final class decorator in pure mode. Was previously rejected for ↵Stefan Behnel2017-12-151-5/+8
| | | | | | Python classes with an @cclass decorator. Closes #2040.
* initial attempt to evaluate "@coroutine" at compile time by making the ↵Stefan Behnel2017-11-161-1/+18
| | | | | | resulting coroutine iterable Signed-off-by: Stefan Behnel <stefan_ml@behnel.de>
* Implement line tracing for generators and coroutines.Stefan Behnel2017-10-311-0/+2
| | | | Closes #1949.
* Trivial typo fixesUnknown2017-10-171-2/+2
| | | | | Most are non-user facing. Found using: `codespell -d -q 3`
* Allow typeof(...) to be used in a type context.Robert Bradshaw2017-10-141-2/+4
|
* Allow pure python annotations in type declarations.Robert Bradshaw2017-10-141-2/+7
| | | | Related to #1838.
* Remove accidental use of "await" as a name as it becomes a keyword in Py3.7.Stefan Behnel2017-10-071-2/+2
| | | | Closes #1916.
* Turn compiler assertion into an error since it's triggered by user code.Stefan Behnel2017-10-031-3/+8
| | | | | Considered to make it a warning, but CPython's forgiving behaviour seems unhelpful. Can still make it a warning later. Closed #1905.
* Make vtable order of extension types with fused methods only dependant on ↵Stefan Behnel2017-09-201-0/+7
| | | | | | | | the original declaration order (e.g. in the .pxd file). Previously, fused methods were specialised and expanded on first use, which lead to an arbitrary order in the vtable. Also fixes compile failures when inheriting from base types with fused cdef methods. Fixes #1873.
* Attempt to use a faster exception value for return type annotations that ↵Stefan Behnel2017-09-091-1/+8
| | | | | | | | | | | | | | check for exceptions. Inside of a module, it is safe to convert a function declared cdef int func() except *: ... into cdef int func() except? -1 because a) we need an exception return value anyway and b) there will always be an explicit exception check afterwards. Thus, changing the function implementation itself is safe. We must exclude functions that are only declared but not implemented since we do not control their signature and it is not safe to assume a specific exception return value if it is not declared.
* Implement @cython.exceptval() decorator to make the "except x" signature ↵Stefan Behnel2017-09-031-4/+23
| | | | | | declaration available in pure Python mode. Closes #1653.