diff options
author | Hernan Grecco <hernan.grecco@gmail.com> | 2014-05-08 21:08:09 -0300 |
---|---|---|
committer | Hernan Grecco <hernan.grecco@gmail.com> | 2014-05-08 21:08:09 -0300 |
commit | 66ae1c178f5b344a1eafac8049346333d9f1c096 (patch) | |
tree | d2f6fb53d50403b83e4adcbb1211e9b27d6886f9 | |
parent | 6425ba71cc16f6e4651da2b6b8fa9793144ba065 (diff) | |
download | pint-66ae1c178f5b344a1eafac8049346333d9f1c096.tar.gz |
Return None in functions that modify quantities in place
- Quantity.ito
- Quantity.ito_base_units
See:
https://docs.python.org/3.3/tutorial/datastructures.html#id3
BACKWARDS INCOMPATIBLE CHANGE
-rw-r--r-- | pint/quantity.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pint/quantity.py b/pint/quantity.py index 2860f0a..467cff7 100644 --- a/pint/quantity.py +++ b/pint/quantity.py @@ -224,7 +224,8 @@ class _Quantity(object): self._magnitude = self._convert_magnitude(other, *contexts, **ctx_kwargs) self._units = other - return self + + return None def to(self, other=None, *contexts, **ctx_kwargs): """Return Quantity rescaled to different units. @@ -244,7 +245,8 @@ class _Quantity(object): self._magnitude = self._convert_magnitude(other) self._units = other - return self + + return None def to_base_units(self): """Return Quantity rescaled to base units |