Trying to cythonize an f-string with nested double quotes fails with an error message. This might be wholly intentional and reasonable, but the nested double quotes are valid in python 3.12 and the cython-lint tool automatically formats your code to use them (also filed a bug report for cython-lint)
Error compiling Cython file:
------------------------------------------------------------
...
def function():
a = f"foo [{"bar"}]"
^
------------------------------------------------------------
test.pyx:2:17: empty expression not allowed in f-string
Error compiling Cython file:
------------------------------------------------------------
...
def function():
a = f"foo [{"bar"}]"
^
------------------------------------------------------------
test.pyx:2:17: missing '}' in format string expression
Error compiling Cython file:
------------------------------------------------------------
...
def function():
a = f"foo [{"bar"}]"
^
------------------------------------------------------------
def function(): a = f"foo [{"bar"}]" print(a)
Cythonizing correctly and when calling the function outputting:
foo ["bar"]
Linux (Ubuntu 22.04)
3.12.3
3.0.10
No response
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #6208 as not planned.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Duplicate of #5452. Just hasn't been done yet.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()