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
DM-29117: Allow dict interface to upgrade integer types #64
Conversation
int can change to longlong. longlong will not downgrade to an int.
python/lsst/daf/base/propertyContainer/propertyContainerContinued.py
Outdated
Show resolved
Hide resolved
On second thought, how does the handling of existing types mesh with |
I was wondering about array items, especially since we already only look at the first element in an array. I'll add a test but surely it would be broken already so may simply be broken differently after this. |
Looks like it just changes the exception from an out-of-range to a mismatched-type. And adding smaller values to larger types should work correctly. |
It issues TypeError if you add a large number to an existing small int type. They do come from different parts of the pybind11 interface. That doesn't seem fixable (and is not part of the One thing that is fixable is dealing with initializing with |
|
Previously [1, LARGE] failed because we only looked at the first value to determine the range.
and also add some tests.
They are not downgraded so an Int64 will stay an Int64 even if assigned "42" but an Int32 will upgrade to an Int64 if needed.