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
A possible improvement would be const-folding expressions that would be shorter as a constant value.
Example:
SOME_VARIABLE = (((123 * 456) + 789) // 10) & 0xabcdef
can be transformed into
SOME_VARIABLE=1063
Note that the Python interpreter will do this at compile-time anyway, so it won't have any effect on the code that is actually run.
>>> import dis >>> dis.dis("(((123 * 456) + 789) // 10) & 0xabcdef")
0 0 RESUME 0 1 2 LOAD_CONST 0 (1063) 4 RETURN_VALUE
The text was updated successfully, but these errors were encountered:
Thanks for creating an issue @kotnen, keep any eye out for this in the next release 😄
A possible improvement would be const-folding expressions that would be shorter as a constant value.
Example:
can be transformed into
Note that the Python interpreter will do this at compile-time anyway, so it won't have any effect on the code that is actually run.
The text was updated successfully, but these errors were encountered: