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

Optimization: pystr.isprintable() -> Py_UNICODE_ISPRINTABLE(pystr) #3277

Open
jbrockmendel opened this issue Dec 20, 2019 · 1 comment
Open

Optimization: pystr.isprintable() -> Py_UNICODE_ISPRINTABLE(pystr) #3277

jbrockmendel opened this issue Dec 20, 2019 · 1 comment

Comments

@jbrockmendel
Copy link
Contributor

@jbrockmendel jbrockmendel commented Dec 20, 2019

I think these should be equivalent, but the generated C I'm seeing doesn't appear to be using Py_UNICODE_ISPRINTABLE.

@scoder

This comment has been minimized.

Copy link
Contributor

@scoder scoder commented Dec 21, 2019

str.isprintable() does not exist in Py2, so applying this optimisation would turn a Python runtime exception into a C compile time error.
Can be done in Cython 3.1.

@scoder scoder added this to the 3.1 milestone Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.