Skip to content

Commit

Permalink
IntegerType needs to roundtrip. Add conversion to int, float
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Oct 24, 2018
1 parent 5bc7429 commit ee74b2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion asdf/tags/core/integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ee74b2c

Please sign in to comment.