Skip to content

Commit

Permalink
Implemented the opencoinage.Token#__long__, #__hex__ and #__oct__ met…
Browse files Browse the repository at this point in the history
…hods.
  • Loading branch information
artob committed Oct 17, 2010
1 parent 747ea0e commit 16c45cd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/python/opencoinage/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,16 @@ def is_signed(self):

def __int__(self):
"""Returns the integer representation of this token."""
return self.identifier
return int(self.identifier)

def __long__(self):
"""Returns the integer representation of this token."""
return long(self.identifier)

def __oct__(self):
"""Returns the octal representation of this token."""
return oct(self.identifier) # FIXME

def __hex__(self):
"""Returns the hexadecimal representation of this token."""
return hex(self.identifier) # FIXME

0 comments on commit 16c45cd

Please sign in to comment.