Skip to content

Commit a00fdeb

Browse files
authored
Fix str() + Content()
1 parent 906af24 commit a00fdeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/textual/content.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,10 @@ def __add__(self, other: Content | str) -> Content:
760760
return content
761761
return NotImplemented
762762

763-
def __radd__(self, other: Content | str) -> Content:
764-
if not isinstance(other, (Content, str)):
763+
def __radd__(self, other: str) -> Content:
764+
if not isinstance(other, str):
765765
return NotImplemented
766-
return self + other
766+
return Content(other) + self
767767

768768
@classmethod
769769
def _trim_spans(cls, text: str, spans: list[Span]) -> list[Span]:

0 commit comments

Comments
 (0)