summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHernan Grecco <hernan.grecco@gmail.com>2014-05-08 21:08:09 -0300
committerHernan Grecco <hernan.grecco@gmail.com>2014-05-08 21:08:09 -0300
commit66ae1c178f5b344a1eafac8049346333d9f1c096 (patch)
treed2f6fb53d50403b83e4adcbb1211e9b27d6886f9
parent6425ba71cc16f6e4651da2b6b8fa9793144ba065 (diff)
downloadpint-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.py6
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