fix bugs in GenericText
This commit is contained in:
parent
189e0178c4
commit
80036d3dda
1 changed files with 6 additions and 4 deletions
|
@ -86,12 +86,14 @@ class GenericText:
|
|||
def __add__(self, other):
|
||||
if not self.has_value():
|
||||
return other
|
||||
if not other.has_value():
|
||||
return self
|
||||
if isinstance(other, GenericText):
|
||||
if not other.has_value():
|
||||
return self
|
||||
return GenericText(self.text + other.text)
|
||||
else:
|
||||
return GenericText(self.text + other)
|
||||
|
||||
def __iadd__(self, other):
|
||||
self.text = self + other
|
||||
def __radd__(self, other):
|
||||
if other is None:
|
||||
return self
|
||||
return other + self
|
||||
|
|
Loading…
Reference in a new issue