- 19 Apr, 2022 1 commit
-
-
Max Bachmann authored
The current implementation of iterators had the following bugs: - it was possible to assign `const_iterator` to `iterator` - it was not possible to assign `iterator` to `const_iterator` - operator* did not always return `value_type` e.g. for `const_iterator` this often returned `T&` instead of `const value_type&` - increment operators always returned `iterators`. This caused e.g. `const_iterator + 1` to result in a `iterator` instead of a `const_iterator` - comparision operators could not be used to compare `iterators` and `const_iterators` (`const_iterator == iterator`)
-
- 18 Apr, 2022 8 commits
-
-
Stefan Behnel authored
Lists of "negative" length are also empty, and that's the case we special-case later in an inline function, so use the same condition for consistency and easy C compiler optimisation. See https://github.com/cython/cython/pull/4734
-
Richard Barnes authored
Some code I have uses lxml. When I compile and run lxml with LLVM-12's undefined behaviour sanitizer, I see this: ``` lxml/4.6.3/cython_parts=etree.c/etree.c:191228:65: runtime error: applying zero offset to null pointer #0 0x7faedc799e7c in __Pyx_PyList_GetSlice lxml/4.6.3/cython_parts=etree.c/etree.c:191228 #1 0x7faedc6b3723 in __pyx_f_4lxml_5etree_9_ErrorLog_copy lxml/4.6.3/cython_parts=etree.c/etree.c:38092 #2 0x7faedc77636e in __pyx_f_4lxml_5etree___copyGlobalErrorLog lxml/4.6.3/cython_parts=etree.c/etree.c:40203 #3 0x7faedc775a5c in __pyx_pf_4lxml_5etree_9LxmlError___init__ lxml/4.6.3/cython_parts=etree.c/etree.c:21080 #4 0x7faedc774dff in __pyx_pw_4lxml_5etree_9LxmlError_1__init__ lxml/4.6.3/cython_parts=etree.c/etree.c:21019 ``` which implies that Cython's generating undefined behaviour. Making an early exit from the modified function (essentially by hoisting an early exit from one level lower in the stack) avoids this.
-
Stefan Behnel authored
CI: Use same capital case package name spelling as other dependencies do. Seems like pip can get confused about this (maybe just temporarily).
-
Stefan Behnel authored
-
Stefan Behnel authored
-
scoder authored
This is used by some optimisations for builtins that call C-API functions directly but need to convert None arguments to NULL or special integer values in order to mimic the original Python interface. Also add and backport the CPython macros for None checks (and True/False, while we're at it): https://docs.python.org/3/c-api/structures.html#c.Py_Is Closes https://github.com/cython/cython/issues/4737 See https://github.com/cython/cython/issues/4706
-
Stefan Behnel authored
-
da-woods authored
Fixes a bug introduced by https://github.com/cython/cython/commit/ae4ade8daeae206db68583f2f4b9c1cbce9cba75 for PyPy.
-
- 16 Apr, 2022 2 commits
-
-
Stefan Behnel authored
-
scoder authored
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 d395a56f.
-
- 15 Apr, 2022 5 commits
-
-
Max Bachmann authored
-
Stefan Behnel authored
-
Stefan Behnel authored
Use "\x20" instead of a plain space at the end of a doctest output line to make it easier to edit. Some editors strip off trailing whitespace.
-
Stefan Behnel authored
-
da-woods authored
It causes issues while profiling or debugging where global variables can end up inadvertently changed. Fixes https://github.com/cython/cython/issues/4609
-
- 12 Apr, 2022 5 commits
-
-
Stefan Behnel authored
-
da-woods authored
-
Jordan Brière authored
The condition should only evaluate to True when assigning __dict__, but it currently does for _, d, i, etc. as well as resulting in the following potential issues: * Non-member are being assigned to the object instead of raising. * The one-field rule can be bypassed. * Valid members that pass the condition are being assigned raw and are never cast to the specified type.
-
Jordan Brière authored
The condition should only evaluate to True when assigning __dict__, but it currently does for _, d, i, etc. as well as resulting in the following potential issues: * Non-member are being assigned to the object instead of raising. * The one-field rule can be bypassed. * Valid members that pass the condition are being assigned raw and are never cast to the specified type.
-
da-woods authored
The presence of this generic special method should not prevent Cython from making a class pickleable. Fixes https://github.com/cython/cython/issues/4730
-
- 10 Apr, 2022 2 commits
-
-
da-woods authored
-
da-woods authored
Closes https://github.com/cython/cython/issues/4704
-
- 07 Apr, 2022 6 commits
-
-
Stefan Behnel authored
-
Jakub Kulík authored
Closes https://github.com/cython/cython/issues/4722
-
Jakub Kulík authored
Closes https://github.com/cython/cython/issues/4722
-
Stefan Behnel authored
-
Stefan Behnel authored
Disable "CYTHON_UPDATE_DESCRIPTOR_DOC" for Pyston. It was previously only enabled for CPython and should only have been enabled additionally for recent PyPy versions.
-
Stefan Behnel authored
Stop using "PyBytesObject.ob_shash" in Py3.11, where it is deprecated. It was just an optimisation that isn't very important for byte strings any more. Closes https://github.com/cython/cython/issues/4721
-
- 06 Apr, 2022 1 commit
-
-
Matus Valo authored
-
- 05 Apr, 2022 1 commit
-
-
Robert Bradshaw authored
Add exception handling for `libcpp::stack::push`
-
- 01 Apr, 2022 5 commits
-
-
Matti Picus authored
-
Matti Picus authored
-
Stefan Behnel authored
-
Stefan Behnel authored
-
Julien Jerphanion authored
-
- 31 Mar, 2022 3 commits
-
-
da-woods authored
Since cimporting directly from "cpython" has long been deprecated. e.g. https://github.com/cython/cython/issues/4707
-
Oleksandr Pavlyk authored
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
-
Stefan Behnel authored
The license follows that of the official Python logo, which it is derived from.
-
- 27 Mar, 2022 1 commit
-
-
Matti Picus authored
-