From a73d30035c212cefab1c11c33d943d616728ce89 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 7 Feb 2020 11:32:18 -0500 Subject: Simplified ColorBase.__add__() --- cmd2/ansi.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'cmd2/ansi.py') diff --git a/cmd2/ansi.py b/cmd2/ansi.py index 8cbf7e37..27086d4a 100644 --- a/cmd2/ansi.py +++ b/cmd2/ansi.py @@ -32,14 +32,8 @@ class ColorBase(Enum): Base class for fg and bg classes This expects the child classes to define enums of: color name -> ANSI color sequence """ - def __str__(self) -> str: - """Return ANSI color sequence instead of enum name""" - return self.value - def __add__(self, other: Any) -> str: """Return self + other as string""" - if isinstance(other, (fg, bg)): - other = str(other) return self.value + other def __radd__(self, other: Any) -> str: -- cgit v1.2.1