diff options
author | Hernan Grecco <hernan.grecco@gmail.com> | 2017-06-27 21:43:58 -0300 |
---|---|---|
committer | Hernan Grecco <hernan.grecco@gmail.com> | 2017-06-27 21:43:58 -0300 |
commit | 245b8ee84adc445cfb4e42ad2689df5e242022a3 (patch) | |
tree | 484cb3ef2de1257b2c8605bac7497630d149b924 /pint/registry_helpers.py | |
parent | be9b046553e014ca19b79400655535de32c88156 (diff) | |
download | pint-245b8ee84adc445cfb4e42ad2689df5e242022a3.tar.gz |
Put explicit comparison for shorter ureg.check args than values
A dimensionless UnitsContainer (which bool evaluates to false) is not the
same as non defined dimensional check
Fix #532
Diffstat (limited to 'pint/registry_helpers.py')
-rw-r--r-- | pint/registry_helpers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pint/registry_helpers.py b/pint/registry_helpers.py index f8fea32..e864a7c 100644 --- a/pint/registry_helpers.py +++ b/pint/registry_helpers.py @@ -210,7 +210,7 @@ def check(ureg, *args): @functools.wraps(func, assigned=assigned, updated=updated) def wrapper(*values, **kwargs): for dim, value in zip_longest(dimensions, values): - if dim and value.dimensionality != dim: + if dim is not None and value.dimensionality != dim: raise DimensionalityError(value, 'a quantity of', value.dimensionality, dim) return func(*values, **kwargs) |