-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-132732: Treat bytes
as constants in _Py_uop_sym_is_safe_const
#136033
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
One thing that slightly worries me about this is that comparing |
Ok let's not do this then. We still need to fix the long stuff though so @sobolevn are you open to that or do you want me to handle it? |
I opened PR #136040 to fix the compact ints issue. |
Did you mean checking for |
You can fetch the value once at the start of optimization time in |
Or, simpler, just explicitly disallow optimizing the problematic comparisons. |
If one of the values is of type bytes, require the other to be as well. |
Not just comparisons. BINARY_OP as well. This is a little annoying and more involved than I expected, so I'd say let's just ignore it for now? |
What |
Not BytesWarning. BINARY_OP (str, bytes) will throw. |
Same for |
This is just different because it’s a warning, to clarify. |
Yeah the optimizer currently doesn't do that. Opened a PR to do so #136048 |
I opened https://discuss.python.org/t/consider-deprecating-and-eventually-removing-b-cli-flag/96903 about possibly removing this warning in the future versions. It does not seem very useful :( |
I fixed the merge conflict. Sorry, I am rather new to the JIT internals, and I don't quite understand the
Is there anything I need to do in this PR to address them? |
We plan to follow up shortly with COMPARE_OP here #130415 |
Ok then :) |
Uh oh!
There was an error while loading. Please reload this page.