summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
Commit message (Collapse)AuthorAgeFilesLines
* Mangle cname for closures in derived c class (GH-2990)Josh Tobin2019-06-111-1/+4
|
* Add missing return type annotation to generators and coroutines.Stefan Behnel2019-03-041-1/+2
| | | | Closes GH-2884.
* 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.
* Work around compiler crash due to missing 'env' (before declaration ↵Stefan Behnel2017-09-021-2/+5
| | | | analysis) when combining @ccall with argument annotations.
* Avoid useless instance assignment on NameNode to save a bit of memory.Stefan Behnel2017-09-021-1/+3
|
* Merge branch 'master' into gen_exc_handlingStefan Behnel2017-08-251-3/+8
|\
| * Simplify TrackNumpyAttributes transform.Stefan Behnel2017-08-211-3/+8
| |
* | Move exception state cleanup into generator body code to allow a distinction ↵Stefan Behnel2017-08-241-1/+6
| | | | | | | | between normal yields and yields in except blocks. They require different handling according to what CPython does.
* | Keep direct closure of generators and coroutines intact during cleanup by ↵Stefan Behnel2017-08-201-0/+3
|/ | | | disabling their tp_clear() as they still need their closure for handling the final GeneratorExit call.
* Merge pull request #1802 from scoder/_pep525_async_genscoder2017-08-091-33/+61
|\ | | | | PEP 525: asynchronous generators
| * disambiguate attribute name ("is_async_gen" it too close to an existing ↵Stefan Behnel2017-08-081-1/+1
| | | | | | | | "is_asyncgen")
| * repair scoped comprehensions inside of generators and async functions by ↵Stefan Behnel2017-08-071-14/+19
| | | | | | | | allowing their loop variables to be added to closures when necessary
| * implement PEP 530 by allowing async generator expressionsStefan Behnel2017-08-041-5/+16
| |
| * in generators/coroutines, save away the current exception in the 'return' ↵Stefan Behnel2017-07-301-1/+6
| | | | | | | | case of finally clauses as 'return' actually raises an (Async)StopIteration exception
| * solve most of the issues with failing async-gen tests, some asyncio tests ↵Stefan Behnel2017-07-291-2/+3
| | | | | | | | are still failing
| * allow yield in async def functions (which turns them into async generators)Stefan Behnel2017-07-271-12/+18
| |
* | Fix a compiler crash when looking up cython.view.array() as a callable ↵Stefan Behnel2017-07-311-13/+13
|/ | | | | | function with non-trivial keyword arguments. Closes #1598.
* Suppress special casing of attribute names in closure classes since they are ↵Stefan Behnel2017-07-251-0/+1
| | | | | | not user defined and any local variable name is allowed without being special. Closes #1797.
* minor readability/safety fixStefan Behnel2017-07-221-1/+1
|
* Minor safety/speed fix to prevent looking for a "__dict__" in an unpickled ↵Stefan Behnel2017-07-211-2/+2
| | | | object if we don't have anything to fill it with in the first place.
* Escape another local variable in generated pickle helper function to prevent ↵Stefan Behnel2017-07-211-2/+2
| | | | conflicts with the user defined class name. See #1786.
* Don't conflict with a class named 'result' in auto-pickleJason Madden2017-07-201-7/+7
| | | | Fixes #1786.
* Avoid pickling objects with struct attributes.Robert Bradshaw2017-07-101-3/+12
| | | | Extern structs may only be partially declared.
* Allow self-referential members in default pickling.Robert Bradshaw2017-07-081-21/+37
|
* Merge branch 'finally-fix'Robert Bradshaw2017-07-061-0/+2
|\
| * Don't generate pickling for types that already have a __getstate__ method.Robert Bradshaw2017-07-061-0/+2
| |
* | Avoid generating utility code unless it's actually used.Robert Bradshaw2017-07-051-2/+7
| | | | | | | | This should resolve #1757.