| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Also, make sure that we correctly allow resetting directives, even if the new value is the same as the value from outside (since we might already have set it differently in the same directives block).
|
|
|
|
| |
Closes https://github.com/cython/cython/issues/5399
|
|
|
|
| |
the normal directives dict unless it's being used.
|
| |
|
|
|
|
| |
Tries to provide some helpful hints for https://github.com/cython/cython/issues/5288
where people may be trying to cimport directives/types as if they were a module.
|
|
|
|
|
| |
that have no children (GH-5336)
Closes https://github.com/cython/cython/issues/5235
|
|
|
|
|
|
|
| |
Error in capitalization.
Closes https://github.com/cython/cython/issues/5270
Context managers were being optimized into a non-working state when involving a CloneNode.
Closes https://github.com/cython/cython/issues/5268
|
|
|
|
|
| |
Provides a decorator to automatically transform a cdef function into a Numpy ufunc (with the loop embedded in the function so hopefully pretty efficient).
Closes https://github.com/cython/cython/issues/4758
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(and "struct S"/"union U")
This appears to be an old Pyrex feature introduced in
https://github.com/cython/cython/commit/9bac9c2e014ed63c2ac435e9b431fae124fba668
to provide a way of "forward cimporting" a class. I originally tried to make
a test for it, but couldn't actually come up with a useful way
of using it in the intended way, where the name would be unavailable
initially but avaialble later.
It looks to be completely untested, and responsible for some missing
coverage in Nodes.py (https://github.com/cython/cython/issues/4163).
The large section containing
```
if kind == 'struct' or kind == 'union': # 8479 ↛ 8480
```
I propose to fix the missing coverage by killing off the feature.
The only people I could find using this syntax were H5Py, who
look to have removed their sole use of it 3 years ago
https://github.com/h5py/h5py/commit/8d2498c7f5e3fec884ff56e9aca905c325d82484
Therefore it seems a good candidate to go in Cython 3
|
|
|
| |
Relaxes the grammar restrictions on decorators
|
|
|
| |
Part of the bug fixes in https://github.com/cython/cython/issues/4956
|
|
|
|
|
| |
As a result of f946fe22fff32077dc58beeb64ec1ebc85d37632
And fix at least one pre-existing reference counting leak for memoryview references in things like
`any(i > 0 for i in memview)`
|
|
|
|
|
|
|
|
| |
Fixes #1159.
This should be a simpler way of dealing with the long-standing generator and comprehension scoping issues. Unlike the previous PR it is fairly non-intrusive (i.e. doesn't wrap everything in `ResultRefNodes`) and therefore the changes should be more reasonable. Instead it:
* Gives `IteratorNode` a scope (pointed at the outer scope rather than the scope of the generator/comprehension)
* Tags each `ExprNode` inside the generator iterator sequence with a number, and uses those tags later to work out what needs to be converted to an argument for the generator. If an `ExprNode` is optimized out then that's fine - one of its children will have been tagged.
|
|
|
|
|
|
|
|
| |
Fixes #4953.
Before this change the annotations were being treated as
"dataclass-related" annotations, and thus being made "public".
|
|
|
|
| |
Closes https://github.com/cython/cython/issues/4947
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
is blocked at runtime.
Also, pass "usedforsecurity=False" in Py3.9+ to unblock MD5 also on some security constrained systems (FIPS).
Closes https://github.com/cython/cython/issues/4909
|
| |
| |
| |
| |
| |
| | |
(GH-4749)"
This reverts commit 74073417c4f7e616af0a139a55f790f1ec7fe728.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes https://github.com/cython/cython/issues/4637
See See https://github.com/cython/cython/issues/3556
* Acquire the GIL in nogil functions only when strictly needed on function exit, e.g. for cleaning up temp variables from with-gil blocks or adding tracebacks.
See https://github.com/cython/cython/issues/3554
* Make the GIL-avoidance in 7d99b0f0 actually work in nogil functions and not just nogil sections.
See https://github.com/cython/cython/issues/3558
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(GH-4703)" (GH-4742)
PR 4703 was an incomplete backport of the changes needed for #3554 and generates incorrect C code.
See https://github.com/cython/cython/issues/3554
Reverts https://github.com/cython/cython/pull/4703
This reverts commit d395a56f8e68ee563f866d0dec5a31a37f77df9e.
|
| |
| |
| |
| |
| |
| | |
Acquire the GIL in nogil functions only when strictly needed on function exit, e.g. for cleaning up temp variables from with-gil blocks or adding tracebacks.
Closes GH-3554
Closes GH-4637
|
| |
| |
| |
| |
| | |
Fixes https://github.com/cython/cython/issues/4836
Bug introduced by https://github.com/cython/cython/commit/8c7b0f3fb745aa7bd0afedfbeb862eecc5fdff0c
|
|\ \
| |/ |
|
| |
| |
| |
| | |
presented checksums, not just the compile time ones.
|
| |
| |
| |
| |
| |
| | |
Cython 3.x pickles now. Otherwise stick to MD5 since that was used before.
Closes https://github.com/cython/cython/issues/4680
|
| |
| |
| |
| | |
Fixes https://github.com/cython/cython/issues/3647
|
| |
| |
| |
| | |
Closes https://github.com/cython/cython/issues/3594
|
| |
| |
| |
| |
| |
| | |
0.x pickles. Otherwise switch to SHA-256 since that should be safe enough to stay available in Python's hashlib module for another while.
Closes https://github.com/cython/cython/issues/4680
|
| |
| |
| |
| |
| |
| |
| | |
Fixes https://github.com/cython/cython/issues/4092
Nested cdef classes are not tested because they don't officially work
at this stage (see https://github.com/cython/cython/issues/4572).
It should be tested if/when they're fully supported.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New decorator/function "@cython.dataclasses.dataclass" and "cython.dataclasses.field()" to mark dataclasses and their fields.
Tries to match the interface provided by a regular dataclass as much as possible.
This means taking the types from the dataclasses module if available (so they match exactly) or a fallback Python version that just implements the core parts (executed with "PyRun_String()" in the C source).
Use of placeholders in generated "__init__" code means the code in the C file isn't hugely readable. Probably not a huge issue, but don't really see a way round that.
As part of this I've also also implemented a Cython version of "typing.ClassVar". Although really designed for use with dataclasses it behaves sensibly when used in types in a normal cdef class. This is worth documenting more thoroughly.
Closes https://github.com/cython/cython/issues/2903
|
| |
| |
| | |
Closes https://github.com/cython/cython/issues/2636
|
| |
| |
| |
| | |
need it.
|
| |
| |
| |
| | |
visitchild() method.
|
| |
| |
| |
| |
| | |
Annotations attached to namenodes weren't correctly processed with "InterpretCompilerDirectivesTransform"
Closes https://github.com/cython/cython/issues/4514
|
| |
| |
| |
| |
| |
| |
| | |
Also adds a check whether we have the GIL before doing so. This
is important because Py_UNBLOCK_THREADS is documented as unsafe
if we don't hold the GIL.
Closes https://github.com/cython/cython/issues/4137
|
| |
| |
| |
| |
| |
| | |
A few children of function nodes need to be consistently evaluated
outside the function scope. This PR attempts to do so and thus
fixes https://github.com/cython/cython/issues/4367.
|
| |
| |
| |
| |
| | |
These were lost when cdef properties (for extern types) were introduced.
Closes #4322 (based on my interpretation of the problem as an error-reporting issue)
|
| |
| |
| |
| | |
compare the 'directivetype' to 'str', which misses Py2 str when compiling with language level 3.
|
| |
| |
| |
| |
| |
| |
| | |
* Fix class attributes access where cpp_locals=False.
* Add "no-cpp-locals" tag to mark a test as not suitable for running with "cpp_locals=True".
* Add a list of "extra_directives" to runtests as additional test mode.
Resolves some issues in https://github.com/cython/cython/issues/4266
|
| | |
|
| |
| |
| |
| |
| | |
This avoids the need for default constructors of stack allocated variables and temps by allowing late initialisation.
Closes https://github.com/cython/cython/issues/4160
|
| |
| |
| |
| |
| |
| | |
Fixes https://github.com/cython/cython/issues/4243
(and probably a bunch more annotation bugs)
AnnotationNode doesn't have any child_attrs/subexprs because it mostly doesn't want to be analyzed (it's just transformed to an evaluable string). However this means that InterpretCompilerDirectives wasn't visiting its children to set is_cython_module and so the typing was failing. I've special-cased InterpretCompilerDirectives to visit AnnotationNode fully.
|
| | |
|
| |
| |
| |
| | |
The problem was they were being skipped with SkipDeclarations
|
| |
| |
| |
| |
| | |
Uses a special package prefix "cython.cimports", followed by the actual .pxd module/package names.
Also allows "import cython.cimports.libc.math as libc_math" etc., rather than only "from ... import ...".
All we need to guard against is that the import does not overwrite the name "cython".
|
| |
| |
| |
| | |
declaration.
|
| |
| |
| |
| | |
This commit fixes a crash of Cython when generator expressions are used in cdef functions in pure python mode.
Closes https://github.com/cython/cython/issues/3477
|
| |
| |
| |
| | |
where appropriate.
|