Use None instead o a special string

master
Salvo 'LtWorf' Tomaselli 2020-08-23 11:16:12 +07:00
parent 33a2a21617
commit 4c101526e6
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 2 additions and 5 deletions

@ -276,9 +276,7 @@ class Relation(NamedTuple):
def outer_right(self, other: 'Relation') -> 'Relation':
'''
Outer right join. Considers self as left and param as right. If the
tuple has no corrispondence, empy attributes are filled with a "---"
string. This is due to the fact that the None token would cause
problems when saving and reloading the relation.
tuple has no corrispondence, empy attributes are filled with a None.
Just like natural join, it works considering shared attributes.
'''
return other.outer_left(self)
@ -287,7 +285,6 @@ class Relation(NamedTuple):
'''
See documentation for outer_right
'''
shared = self.header.intersection(other.header)
# Creating the header with all the fields, done like that because order is
@ -319,7 +316,7 @@ class Relation(NamedTuple):
added = True
# If it didn't partecipate, adds it
if not added:
item = chain(i, repeat('---', len(noid))) #FIXME
item = chain(i, repeat(None, len(noid))) #FIXME
content.append(tuple(item))
return Relation(header, frozenset(content))