We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The function i avoids explicitly boxing 12, but the function f emits a box operation:
i
f
def i() -> object: return 12 def f() -> object: return 1.2
Here's the IR:
def i(): r0 :: object L0: r0 = object 12 inc_ref r0 return r0 def f(): r0 :: object L0: r0 = box(float, 1.2) return r0
Make float literals avoid the boxing operation when they are used in a context that requires a boxed value, similar to integers.
The text was updated successfully, but these errors were encountered:
This should also work for math.pi, etc., that get translated to float literals (see python/mypy#15324).
math.pi
Sorry, something went wrong.
No branches or pull requests
The function
i
avoids explicitly boxing 12, but the functionf
emits a box operation:Here's the IR:
Make float literals avoid the boxing operation when they are used in a context that requires a boxed value, similar to integers.
The text was updated successfully, but these errors were encountered: