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
TypeError: unsupported operand type(s) for *: 'float' and 'Decimal' #46
Comments
This was always very confusing for me but is the standad in Python 2
and in Python 3
|
danielsokolowski
pushed a commit
to danielsokolowski/pint
that referenced
this issue
Aug 16, 2013
…imal magnitudes no longer throws a TypeError caused by attempting to multiply a float with Decimal. Further edge cases for other magnitude types might be required.
Hi @hgrecco, yes I am aware of that - but the issue is with pint itself - I'll clarify below and the tentative fix is to follow:
|
danielsokolowski
pushed a commit
to danielsokolowski/pint
that referenced
this issue
Aug 16, 2013
…imal magnitudes no longer throws a TypeError caused by attempting to multiply a float with Decimal. Further edge cases for other magnitude types might be required.
Here is the pull request: #48 |
You are right. I should not have closed the issue. Thanks! |
Sweet - thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have only traced the bug on surface so I do not understand why this method is called
UnitRegistry.convert(...)
. In a nut shell, using Decimal magnitude as opposed to float causes this method to fail as it tried to multiply Decimal and floats together - below is the stack trace.The text was updated successfully, but these errors were encountered: