Skip to content

Commit a73d300

Browse files
committed
Simplified ColorBase.__add__()
1 parent 10b9f3e commit a73d300

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

cmd2/ansi.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,8 @@ class ColorBase(Enum):
3232
Base class for fg and bg classes
3333
This expects the child classes to define enums of: color name -> ANSI color sequence
3434
"""
35-
def __str__(self) -> str:
36-
"""Return ANSI color sequence instead of enum name"""
37-
return self.value
38-
3935
def __add__(self, other: Any) -> str:
4036
"""Return self + other as string"""
41-
if isinstance(other, (fg, bg)):
42-
other = str(other)
4337
return self.value + other
4438

4539
def __radd__(self, other: Any) -> str:

0 commit comments

Comments
 (0)