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

Black fails when using sizeof #3

Open
cphyc opened this issue Mar 18, 2021 · 0 comments
Open

Black fails when using sizeof #3

cphyc opened this issue Mar 18, 2021 · 0 comments

Comments

@cphyc
Copy link

cphyc commented Mar 18, 2021

Describe the bug

Black fails on a simple cython file which uses sizeof.

To Reproduce

  1. Create the file
# file.pyx
cdef INT32_SIZE = sizeof(int)
  1. Apply black on it:
$ black -t cython file.pyx
error: cannot format file.pyx: Cannot parse: 12:5: cdef INT32_SIZE = sizeof(np.int32_t)
Oh no! 💥 💔 💥
1 file failed to reformat.

Expected behavior
This should not fail as this is a valid cython file.

Environment (please complete the following information):

  • Operating System and Version: ArchLinux, Python 3.9.2, black 19.3b0 (downloaded from the cython_support branch).
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

1 participant