fix bugs in GenericText

This commit is contained in:
Maximilian Keßler 2022-02-08 23:33:43 +01:00
parent 189e0178c4
commit 80036d3dda

View file

@ -86,12 +86,14 @@ class GenericText:
def __add__(self, other):
if not self.has_value():
return other
if isinstance(other, GenericText):
if not other.has_value():
return self
if isinstance(other, GenericText):
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