Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "@nogil" as decorator in pure Python mode #2557

Closed
scoder opened this issue Aug 15, 2018 · 0 comments
Closed

Implement "@nogil" as decorator in pure Python mode #2557

scoder opened this issue Aug 15, 2018 · 0 comments

Comments

@scoder
Copy link
Contributor

scoder commented Aug 15, 2018

Implement this:

@cython.cfunc
@cython.nogil
def func() -> cython.int:
    return 1
  • Add nogil to the list of directives in Cython/Compiler/Options.py.
  • In the AdjustDefByDirectives tree transformation, apply the nogil directive wherever the nogil modifier is allowed, i.e. cdef/@cfunc and cpdef/@ccall functions.
  • Wherever decorators are allowed, but nogil is not, reject it explicitly (because it is no longer rejected by the parser).
  • Write tests for the good cases and for invalid cases.
  • Optionally: allow @nogil on Python (def) functions and interpret it as with nogil.

Also see #2579.

@scoder scoder changed the title Implement nogil as decorator in pure Python mode Implement "nogil" as decorator in pure Python mode Aug 15, 2018
@scoder scoder changed the title Implement "nogil" as decorator in pure Python mode Implement "@nogil" as decorator in pure Python mode Aug 15, 2018
@scoder scoder closed this as completed in 4fc2fd3 Sep 14, 2018
@scoder scoder added this to the 0.29 milestone Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant