Skip to content

Commit

Permalink
Added __len__ method
Browse files Browse the repository at this point in the history
  • Loading branch information
evdb committed Jul 7, 2011
1 parent d99df85 commit 6df5e2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fields.py
Expand Up @@ -59,6 +59,9 @@ def __ge__(self, other):
if other is None or (self.year, self.month, self.day) < (other.year, other.month, other.day):
return False
return True

def __len__(self):
return len( str( self ))

ansi_date_re = re.compile(r'^\d{4}-\d{1,2}-\d{1,2}$')

Expand Down

0 comments on commit 6df5e2a

Please sign in to comment.