| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* Use a custom (although slow) PyLong->cint128 conversion if "_PyLong_AsByteArray()" is missing (in PyPy/Limited API).
* Avoid large integer conversion for enum types (where shift etc. don't work well).
|
|
|
|
|
| |
enabled. (GH-5432)
This shows warnings in CPython (3.12) debug builds and can lead to crashes when GC triggers on an object while deallocating it.
|
|
|
|
| |
'noexcept' for function pointer fields (GH-5386)
|
|
|
|
| |
details (GH-5406)
|
|
|
|
|
|
|
| |
Require the bracketed multiple context managers to be followed by a
colon, so that the bracketed called context manager is identified as
regular parentheses in old-style syntax.
Fixes https://github.com/cython/cython/issues/5403
|
| |
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
was there anyway, just needed moving around a bit.
|
|
|
|
| |
Previously, it said "Expected tuple of size 4, got tuple", which is unhelpful and confusing.
|
|
|
|
|
|
| |
int)") and require "tuple[int, int]" instead.
Closes https://github.com/cython/cython/issues/5397
|
|
|
|
|
|
|
|
|
| |
(GH-5213)
* Avoid redundant subtree analysis in MulNode when multiplying sequences with unknown types.
* Avoid Python int creation when multiplying sequences with integers.
* Also allow a cint mult_factor for sequences, avoiding Python coercion if possible.
* Also optimise (int * ctuple), which will eventually end up as a Python tuple as well.
* Make sure we only apply a "mult_factor" to a Python sequence (not ctuples), and make the re-analysis of TupleNode a little safer.
|
| |
|
| |
|
|
|
|
|
|
| |
printing the exceptions.
In Py3.12, printing the AttributeError calls __getattr__(obj, '__dict__') to suggest typos, which changes the call counts to "__getattr__" in some of the tests.
|
|
|
|
|
|
|
|
| |
side (GH-5371)
See https://github.com/cython/cython/pull/5366
Add a warning for users who already defined "__PYX_EXTERN_C" before that there is a new macro for this.
Also try to reverse-engineer expressive names for the different test cases.
|
|
|
|
|
|
|
|
|
|
|
| |
If a cascaded comparison is partially optimized (i.e. only some
of the comparisons are optimized) then the result types must end up
consistent all the way through. At the moment we select PyObject
which probably isn't the most efficient option, but is the
easiest to implement
We do not require the whole cascaded optimization to succeed.
Instead, we can just get Python comparisons as bool, and just ensure
that the entire cascade has the same type
|
|
|
|
|
|
| |
generally available (GH-5358)
Closes https://github.com/cython/cython/issues/5356
Fixes https://github.com/cython/cython/pull/5302
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
an outer loop.
Closes https://github.com/cython/cython/issues/5347
|
| |
| |
| |
| |
| |
| | |
"PyCapsule_Destructor" function type to document explicitly that it must not emit exceptions.
See https://github.com/scipy/scipy/issues/17234
|
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
It'll only need the GIL on failure (which it can get)
and "power of" type maths is the soft of thing that people are
likely already doing in nogil blocks
|
| | |
|
| |
| |
| |
| |
| | |
This test mirrors the structure of SciPy's `linalg.cython_blas`, `linalg.cython_lapack` and `special.cython_special` modules.
Original bug was resolved in master by https://github.com/cython/cython/pull/4552 (https://github.com/cython/cython/commit/0c8dea13946833606ab7e290d51cd12aee077c04)
|
| |
| |
| |
| |
| |
| |
| | |
Partial fix for https://github.com/cython/cython/issues/5297
Ideally I think we should do something cleverer,
but this'd complicated memoryview dispatch significantly.
This PR just restores the 0.29.x behaviour where None matches the first type.
|
| |
| |
| |
| |
| |
| |
| |
| | |
It looks like Numpy releases the GIL for us (unless it's PyObject
arguments), so we should assume that we don't have the GIL, and
write code to regain it if needed, rather than assuming we need
to release the GIL.
Fixes #5328
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since https://github.com/cython/cython/commit/4993ba6a0194c2fbcf438ae2833f43c33781148d,
we returned the top-level package module instead of the module that was actually imported
with its dotted name ("collections" instead of "collections.abc").
Closes https://github.com/cython/cython/issues/5308
See https://github.com/cython/cython/issues/2854
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The new exception-handling semantics meant that the utility
code always had to check for exceptions on some void nogil functions
(requiring us to re-acquire the GIL). This made performance
noticeably worse under some circumstances.
Fix this by making the exception specifications noexcept
for quite a few cdef functions in the memoryview utility code.
Fixes https://github.com/cython/cython/issues/5324
|
| |
| |
| |
| | |
(#5318)
|
| |
| |
| |
| |
| | |
cannot handle long names (GH-5293)
Closes https://github.com/cython/cython/issues/5290
|
| | |
|
| | |
|
| |
| |
| |
| | |
This PR adds the C++ STL cmath header. It's mainly motivated by the new C++17 mathematical special functions (like assoc_laguerre, assoc_legendre, beta, ...) and the C++20 linear interpolation function lerp. However, all other functions are already in libc.math, so I'm not really sure if we should have them in both libc.math and libcpp.cmath.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This used to coerce the nesting tree twice at each condition, once for `coerce_to()` and once for `analyse_result_type()`, both calling each other for the entire subtree.
Closes https://github.com/cython/cython/issues/5197
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow code like the following to compile:
cimport m
def my_func():
cdef m.CppClass.NestedClass c
where m is a module, CppClass is a C++ class and NestedClass is a nested class inside CppClass.
|
| |
| |
| | |
Allow it to use a Py-tuple instead of a ctuple
|
| |
| |
| |
| |
| |
| | |
Force utility code to come before pxd code which comes before
module code. This specifically fixes #5269, (where the "ToPy"
functions for cpdef enums weren't availbale when cyfunctions
were created). But I think it's a good idea anyway.
|
| |
| |
| |
| | |
callback used by qsort.
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| | |
Closes https://github.com/cython/cython/issues/5070
|
| | |
|
| |
| |
| |
| | |
inferring either Python float or C double from the Python type annotation of 'x' instead, but as it stands, we infer the types from the ctuple assignment.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If you had a function
```
def f(**kwds):
return locals()
```
then 'kwds' would not appear in locals. Found while investigating
one of the coverage gaps listed in
https://github.com/cython/cython/issues/4163.
```
allow_null = all(ref.node.allow_null for ref in self.starstar_arg.entry.cf_references) # 3772 ↛ exit
if allow_null: # 3773 ↛ 3774
code.putln("%s = NULL;" % (self.starstar_arg.entry.cname,))
```
This uncovered code was wrong and has been removed. The only way
I can see to have an `allow_null` reference to the ** argument
would be to use `locals()`, and in this case an empty dict
should be generated.
|