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

[BUG] string in #define macro in cython in notebook #5206

Open
jayenashar opened this issue Jan 10, 2023 · 1 comment
Open

[BUG] string in #define macro in cython in notebook #5206

jayenashar opened this issue Jan 10, 2023 · 1 comment

Comments

@jayenashar
Copy link

Describe the bug

I have an iPython notebook and I can specify cython macros fine with something like

# distutils: define_macros=NAME=VALUE

but now I want to pass VALUE as a string "VALUE"

# distutils: define_macros=NAME="VALUE"

It IS passing a string, but it's passing "__Pyx_L1_".

I tried 'VALUE' and \"VALUE\" but they give compile errors because ' is for a character and \ becomes a "stray".

Code to reproduce the behaviour:

# distutils: define_macros=NAME="VALUE"

Expected behaviour

I expect the macro NAME to be set to "VALUE"

Environment

OS: [e.g. Linux, Windows, macOS] Linux
Python version [e.g. 3.10.2] 3.10.6
Cython version [e.g. 3.0.0a11] 3.0.0a11

Additional context

https://stackoverflow.com/questions/75066010/string-in-define-macro-in-cython-in-notebook#comment132470048_75066010

@realead made me do it

@jayenashar
Copy link
Author

image
can't attach the notebook but here is my test

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