From dc4514e8d033f9bf15f54a8a09ec98c130a8ed13 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sat, 16 Oct 2021 11:41:44 +0100 Subject: [PATCH] float special method added to pyerrors --- pyerrors/pyerrors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyerrors/pyerrors.py b/pyerrors/pyerrors.py index e4262af6..20d64fd5 100644 --- a/pyerrors/pyerrors.py +++ b/pyerrors/pyerrors.py @@ -472,6 +472,9 @@ class Obs: with open(file_name, 'wb') as fb: pickle.dump(self, fb) + def __float__(self): + return self.value + def __repr__(self): return 'Obs[' + str(self) + ']'