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

Allow not None in cdef and cpdef function arguments #3329

Open
jakirkham opened this issue Jan 26, 2020 · 1 comment
Open

Allow not None in cdef and cpdef function arguments #3329

jakirkham opened this issue Jan 26, 2020 · 1 comment

Comments

@jakirkham
Copy link
Contributor

It would be useful to allow not None on cdef and cpdef function arguments as it works with def function arguments.

ref: https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#extension-types-and-none

@McSinyx
Copy link
Contributor

McSinyx commented Jan 26, 2020

Coming from #3328: For future design, I suggest using Python functions, use type annotation, e.g. def func(b: bytes). Explicitly allowing None can be done using def func(b: typing.Optional[bytes]) in Python, and Cython function declaration may want to accept this syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants