diff options
author | Hernan Grecco <hernan.grecco@gmail.com> | 2014-11-07 20:35:01 -0300 |
---|---|---|
committer | Hernan Grecco <hernan.grecco@gmail.com> | 2014-11-07 20:35:01 -0300 |
commit | d682a21f191f3622e07d6bf0721135247c78c5ba (patch) | |
tree | 3a2faa9b81bbcf44cd4bd85c43a4dfdcaf5ded51 | |
parent | 71d40b9048d2945f069b5c5743d7d018a1b31f11 (diff) | |
download | pint-d682a21f191f3622e07d6bf0721135247c78c5ba.tar.gz |
Fix operations with measurments and user defined units.
Close #204
-rw-r--r-- | pint/quantity.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pint/quantity.py b/pint/quantity.py index 069fa0b..a5f6614 100644 --- a/pint/quantity.py +++ b/pint/quantity.py @@ -49,6 +49,8 @@ def _check(q1, other): # Both quantities are the same class and therefore from the same registry. # (Each registry has its own Quantity class) return True + elif q1._REGISTRY is getattr(other, '_REGISTRY', None): + return True elif isinstance(other, _Quantity): # The other object is a Quantity but from another registry. raise ValueError('Cannot operate between quantities of different registries') |