summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Code.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Allow '# cython: …' module level directives in Cython utility code.Stefan Behnel2020-05-151-1/+1
| |
* | Reverse the tuple item order in the utility code caching key to move the ↵Stefan Behnel2020-05-051-1/+1
| | | | | | | | most selective item first (just in case if we ever get dict collisions).
* | Generate function-local error indicator variables whenever "error_goto()" is ↵Stefan Behnel2020-04-291-12/+6
| | | | | | | | | | | | used. This was previously broken by the introduction of the "__PYX_ERR()" macro.
* | Avoid acquiring the GIL at the end of nogil functions (GH-3556)Stefan Behnel2020-04-271-2/+2
| | | | | | | | | | 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.
* | Move the module state generation further down to the latest point before the ↵Stefan Behnel2020-04-261-7/+9
| | | | | | | | | | | | | | module implementation. Ideally, most of the code that is uninteresting for users should be out of the way and not reside before the translated user code. Mark all code section name beginnings in the C code file to make them easier to follow and move around.
* | Clean up default value handling of memory view type.Stefan Behnel2020-04-261-2/+1
| |
* | Make reference counting more type specific by moving it into PyrexTypes ↵da-woods2020-03-241-108/+61
| | | | | | | | | | | | | | (GH-3377) The idea being that struct-types like memoryviews can generate their own reference counting code using a common interface with Python objects.
* | Merge branch '0.29.x'Stefan Behnel2020-03-211-0/+3
|\ \ | |/
| * Enable temps for C functions by using function pointers instead.Stefan Behnel2020-03-211-0/+3
| | | | | | | | Closes GH-3418.
* | Fixed initialization of __Pyx_CachedCFunction in the LIMITED_API (GH-3379)da-woods2020-03-071-2/+5
| | | | | | Strings werren't static for the limited API so had to be set at module init rather than compile time.
* | Cleanup and fix string initialization code for LIMITED_API (GH-3378)da-woods2020-02-271-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cleanup of string initialization code for limited API Now appears in a few large blocks rather than ``` # if CYTHON_LIMITED_API individual string line # endif ``` * Fixed issue with some unicode strings, e.g. ``` # cython: language_level=3str, binding=True def non_ascii_str(): s = 'ø\x20\u0020' assert isinstance(s, str) return s ```
* | Allow tempita utility code to be @required (GH-3375)da-woods2020-02-261-2/+20
| | | | | | "@subsitute: tempita" tag ensures that they are loaded in tempita utility code class
* | Expand LIMITED_API support (GH-3311)Eddie Elizondo2020-02-181-4/+4
| | | | | | | | | | | | | | | | | | * Add more limited api support * Fix Fused Functions * Fixed profile * Use PyModule_GetDict * Simplify __Pyx_Globals * Address issues in CommonStructures * ifdef guard CyFunction and FusedFunction
* | The "memoryview" Python builtin is now cacheable since we no longer support ↵Stefan Behnel2020-01-231-2/+0
| | | | | | | | Py2.6.
* | Add LIMITED_API support and remove static state (GH-3223)Eddie Elizondo2020-01-121-2/+57
| | | | | | Blacklists failing test for now
* | Add a hook to change how `utilities` files are read. (GH-3273)Yu Feng2020-01-111-3/+23
| | | | | | | | | | | | | | | | | | | | * Allow overriding the reading of utilities files. Add set_read_utitlities_hook() to override how utilities files are accessed. This change simplifies how Cython can be packaged into a single file binary executable, where utility files are stored inside the binary executable as package resource.
* | Simplify the utility code loading by requiring the source file to be named ↵Stefan Behnel2019-12-231-30/+5
| | | | | | | | explicitly. It was almost always passed anyway, so having a non-trivial search algorithm in place for a rare case of unnecessary laziness is just code bloat. (GH-3280)
* | Unicode identifiers (PEP 3131) (GH-3081)da-woods2019-08-241-5/+9
| | | | | | Closes #2601
* | Merge branch '0.29.x'Stefan Behnel2019-07-051-1/+1
|\ \ | |/
| * Tighten a condition to make passing None more explicit.Stefan Behnel2019-07-051-1/+1
| |
| * Fix error positions of undefined builtins and constants (GH-3030)Orivej Desh2019-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently Cython generates code like this: int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_NAME = __Pyx_GetBuiltinName(...); if (!__pyx_builtin_NAME) __PYX_ERR(1, 44, __pyx_L1_error) } int __pyx_pymod_exec_MODULE(PyObject *__pyx_pyinit_module) { if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) } When InitCachedBuiltins and InitCachedConstants call __PYX_ERR, they pass the file and line where a builtin is used, but then pymod_exec overwrites it with 1 and 1, and the error message looks like this: File "FILE", line 1, in init MODULE. import os NameError: name 'NAME' is not defined After this change Cython generates: int __pyx_pymod_exec_MODULE(PyObject *__pyx_pyinit_module) { if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; } and prints: File "FILE", line 44, in init MODULE. print(NAME) NameError: name 'NAME' is not defined
* | Fix error positions of undefined builtins and constants (GH-3030)Orivej Desh2019-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently Cython generates code like this: int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_NAME = __Pyx_GetBuiltinName(...); if (!__pyx_builtin_NAME) __PYX_ERR(1, 44, __pyx_L1_error) } int __pyx_pymod_exec_MODULE(PyObject *__pyx_pyinit_module) { if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) } When InitCachedBuiltins and InitCachedConstants call __PYX_ERR, they pass the file and line where a builtin is used, but then pymod_exec overwrites it with 1 and 1, and the error message looks like this: File "FILE", line 1, in init MODULE. import os NameError: name 'NAME' is not defined After this change Cython generates: int __pyx_pymod_exec_MODULE(PyObject *__pyx_pyinit_module) { if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; } and prints: File "FILE", line 44, in init MODULE. print(NAME) NameError: name 'NAME' is not defined
* | Minor cleanup in handling METH_xxx flags (#3004)Jeroen Demeyer2019-06-231-5/+4
| |
* | Use "fast_gil" calls in line tracing code when available, and actually test it.Stefan Behnel2019-03-031-16/+10
| |
* | Merge branch '0.29.x'Stefan Behnel2019-02-021-1/+1
|\ \ | |/
| * Fix warning about invalid escape sequence in regex.Stefan Behnel2019-02-021-1/+1
| |
* | Compile Cython's modules with language_level=3/3str.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-8/+3
| | | | | | | | | | | | bit Linux) and because MD5 is no longer allowed in US FIPS 140-2 environments. Closes #2790.
* | Support for "volatile" keywordJeroen Demeyer2019-01-081-2/+2
| |
* | Merge branch '0.29.x'Stefan Behnel2019-01-021-3/+5
|\ \ | |/
| * Reformat code, add comment.Stefan Behnel2019-01-021-3/+5
| |
| * Fix source of non-deterministic cython output for try/finally statements.Martijn van Steenbergen2019-01-021-3/+3
| | | | | | | | | | | | The __PYX_XDEC_MEMVIEW statements generated for try/finally statements varied per build if there were multiple types of variables to be cleaned up.
* | Fix source of non-deterministic cython output for try/finally statements.Martijn van Steenbergen2019-01-021-3/+3
| | | | | | | | | | | | The __PYX_XDEC_MEMVIEW statements generated for try/finally statements varied per build if there were multiple types of variables to be cleaned up.
* | Merge branch '0.29.x'Stefan Behnel2018-12-121-3/+9
|\ \ | |/
| * Prevent repeated initialisation of constants that overwrite the previously ↵Stefan Behnel2018-12-121-3/+9
| | | | | | | | | | | | created objects without cleanup. Closes #2750.
* | Remove support for Py2.6 and various quirks that special-cased it.gh2692_remove_py26_supportStefan Behnel2018-10-301-6/+0
|/ | | | Closes #2692.
* Deduplicate constant tuples and slices to generate them only once and share ↵Stefan Behnel2018-09-231-3/+10
| | | | | | them across the entire module. Closes #2292.
* Set the maximum line length to 150.gabrieldemarmiesse2018-08-181-1/+2
|
* Generate short wrappers for special methods like "__next__()" to adapt their ↵Stefan Behnel2018-06-171-23/+32
| | | | | | | signature for the PyCFunction entry in PyMethodDef. Previously, their cast to a two-argument PyCFunction was incorrect. See #2363.
* Avoid deepcopying utility code objects since they should not get mutated anyway.Stefan Behnel2018-06-171-0/+4
|
* Remove incorrect function pointer cast again: METH_NOARGS actually takes a ↵Stefan Behnel2018-06-171-6/+3
| | | | second argument.
* Reduce Cython's module size of "Actions", "Scanners", "StringIOTree", ↵Stefan Behnel2018-06-161-0/+1
| | | | "Visitor" and "Code" by disabling auto-pickling.
* Fix function signature casts in PyMethodDef structs that lead to warnings in ↵Stefan Behnel2018-06-161-3/+6
| | | | gcc-8 (and actually make use of the warnings in gcc-8).
* Fix some comments.Stefan Behnel2018-06-161-2/+1
|
* Fix function signature casts in PyMethodDef structs that lead to warnings in ↵Stefan Behnel2018-06-161-1/+9
| | | | gcc-8 (and actually make use of the warnings in gcc-8).
* Mark several one-time functions (used during module init) with ↵Stefan Behnel2018-05-251-4/+4
| | | | CYTHON_SMALL_CODE to reduce their binary code impact on the overall module size.
* Remove permanent output scanning code that eats quite a bit of processing time.Stefan Behnel2018-05-171-4/+0
|
* Optimise CCodeWriter to reduce the call/attribute overhead during C code ↵Stefan Behnel2018-05-101-11/+21
| | | | generation.
* Allow access to long/int internalsJeroen Demeyer2018-05-031-0/+10
|
* Misc typosluz.paz2018-03-121-2/+2
| | | Found via `codespell`