Check for duplicated attributes

Fails to work if attributes are duplicated, raising an appropriate
exception.
master
Salvo 'LtWorf' Tomaselli 2015-02-23 14:17:50 +07:00
parent 512aafd946
commit 0a562ff603
1 changed files with 3 additions and 0 deletions

@ -527,6 +527,9 @@ class header (object):
if not is_valid_relation_name(i):
raise Exception('"%s" is not a valid attribute name' % i)
if len(attributes) != len(set(attributes)):
raise Exception('Attribute names must be unique')
def __repr__(self):
return "header(%s)" % (self.attributes.__repr__())