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
DimensionlessFloat can not be called by hash(obj) I am not sure this is a designed behavior.
DimensionlessFloat
hash(obj)
import labrad.units as U a = U.Value(3, 'ns') type(a['ns']) # float hash(a['ns']) # no error, float number is hashable. b = U.Value(3, 'ns') c = U.Value(1, 'GHz') print(type(b*c)) # DimensionlessFloat print(hash(b*c)) # Type Error # unhashable type: 'DimensionlessFloat'
The text was updated successfully, but these errors were encountered:
One way to solve this problem might be implementing __hash__ method in the WithDimensionlessUnit class (
__hash__
WithDimensionlessUnit
pylabrad/labrad/units.py
Line 979 in 3f4d484
WithUnit
Sorry, something went wrong.
No branches or pull requests
DimensionlessFloat
can not be called byhash(obj)
I am not sure this is a designed behavior.
The text was updated successfully, but these errors were encountered: