summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glucometerutils/common.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/glucometerutils/common.py b/glucometerutils/common.py
index 38f735e..a9968c2 100644
--- a/glucometerutils/common.py
+++ b/glucometerutils/common.py
@@ -54,7 +54,7 @@ _ReadingBase = collections.namedtuple(
'_ReadingBase', ['timestamp', 'value', 'meal', 'comment'])
class Reading(_ReadingBase):
- def __init__(self, timestamp, value, meal='', comment=''):
+ def __new__(cls, timestamp, value, meal='', comment=''):
"""Constructor for the reading object.
Args:
@@ -67,8 +67,8 @@ class Reading(_ReadingBase):
because at least most of the LifeScan devices report the raw data in this
format.
"""
- super(Reading, self).__init__(
- timestamp=timestamp, value=value, meal=meal, comment=comment)
+ return super(Reading, cls).__new__(
+ cls, timestamp=timestamp, value=value, meal=meal, comment=comment)
def get_value_as(self, to_unit):
"""Returns the reading value as the given unit.