Added a convienence method __len__ for cursors; you can remove if you don't like

svn: r12912
This commit is contained in:
Doug Blank 2009-08-07 09:11:13 +00:00
parent 2343bb9da5
commit dd1f4f0b26

View File

@ -106,6 +106,12 @@ class GrampsCursor(object):
"""
return self.source.stat()['ndata']
def __len__(self):
"""
Convienence method to work with len(cursor).
"""
return self.get_length()
def __iter__(self):
"""
Iterator