-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
bitshift typing on unsigned operands is tedious to work with #8002
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
Comments
In Numba we are considering typing based only on the first operand, see numba/numba#2072 |
Numpy is probably casting |
I've hit the same problem. I have thought it would have been better to copy C typing as closely as possible. Then for an algorithm already written in C I can just paste it into python, and not have to worry about wrapping all the constants in uint64. Here's something I had to write last week that demonstrates the annoyance: assert(type(crc) is uint16 and type(onech) is uint8)
ans = uint32(crc ^ onech << uint16(8))
for ind in range(8):
if ans & uint32(0x8000):
ans <<= uint32(1)
ans = ans ^ uint32(4129)
else:
ans <<= uint32(1) |
Effectively fixed by NEP 50 in main/NumPy 2.0. Closing. |
The text was updated successfully, but these errors were encountered: