From a07b878bc299556306f57f4e5f9d5ee3a7d0fd77 Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Wed, 24 Oct 2018 13:25:29 -0400 Subject: [PATCH] IntegerType needs to roundtrip. Add conversion to int, float --- asdf/tags/core/integer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/asdf/tags/core/integer.py b/asdf/tags/core/integer.py index d70d7a4ab..0d1d62972 100644 --- a/asdf/tags/core/integer.py +++ b/asdf/tags/core/integer.py @@ -99,7 +99,13 @@ def from_tree(cls, tree, ctx): if tree['sign'] == '-': value = -value - return value + return IntegerType(value) + + def __int__(self): + return int(self._value) + + def __float__(self): + return float(self._value) def __eq__(self, other): if isinstance(other, Integral):