diff --git a/matrix/colors.py b/matrix/colors.py index 261a5bd..96a4c24 100644 --- a/matrix/colors.py +++ b/matrix/colors.py @@ -43,7 +43,13 @@ except ImportError: from html.parser import HTMLParser -FormattedString = namedtuple("FormattedString", ["text", "attributes"]) +class FormattedString: + __slots__ = ("text", "attributes") + + def __init__(self, text, attributes): + self.attributes = DEFAULT_ATTRIBUTES.copy() + self.attributes.update(attributes) + self.text = text class Formatted(object):