Adds len() to relation

Returns the cardinality
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2015-06-05 18:28:44 +02:00
parent d05c2e2d3c
commit 01dc9391d1

View File

@ -382,6 +382,9 @@ class relation (object):
# comparing content # comparing content
return self.content == other.content return self.content == other.content
def __len__(self):
return len(self.content)
def __str__(self): def __str__(self):
'''Returns a string representation of the relation, can be printed with '''Returns a string representation of the relation, can be printed with
monospaced fonts''' monospaced fonts'''