-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] MNT Use a common language_level cython directive #13630
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, LGTM.
Do you think we could(/should?) do the same for other directives like boundchecks
, wraparound
, cdivision
? Seems like we set them most of the time.
I tried but it was not straightforward :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -61,7 +61,7 @@ def _load_svmlight_file(f, dtype, bint multilabel, bint zero_based, | |||
for line in f: | |||
# skip comments | |||
line_cstr = line | |||
hash_ptr = strchr(line_cstr, '#') | |||
hash_ptr = strchr(line_cstr, 35) # ASCII value of '#' is 35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This was the part missing in #12873 that prevented me to use a global option.
Cython compile directives can be commonly set during cythonization.
This PR does it for the
language_level
directive.There was a file (``_svmlight_format.pyx) where it was still level 2 but it was easily fixable.