# ``twisted`.`python`.`_textattributes`.`_Attribute``

class documentation

`class _Attribute(FancyEqMixin): (source)`

Known subclasses: `twisted.python._textattributes._ColorAttr`, `twisted.python._textattributes._NormalAttr`, `twisted.python._textattributes._OtherAttr`

View In Hierarchy

A text attribute.

Indexing a text attribute with a `str` or another text attribute adds that object as a child, indexing with a `list` or `tuple` adds the elements as children; in either case `self` is returned.

Method | `__getitem__` | Undocumented
Method | `__init__` | Undocumented
Method | `__repr__` | Undocumented
Method | `serialize` | Serialize the text attribute and its children.
Class Variable | `compareAttributes` | Undocumented
Instance Variable | `children` | Child attributes.

Inherited from `FancyEqMixin`:

Method | `__eq__` | Undocumented
Method | `__ne__` | Undocumented

def __getitem__(self, item): (source)

Undocumented

def __init__(self): (source)
overridden in `twisted.python._textattributes._ColorAttr`, `twisted.python._textattributes._OtherAttr`

Undocumented

def __repr__(self): (source)

Undocumented

Returns
`str` | Undocumented

def serialize(self, write, attrs=None, attributeRenderer='toVT102'): (source)
overridden in `twisted.python._textattributes._ColorAttr`, `twisted.python._textattributes._NormalAttr`, `twisted.python._textattributes._OtherAttr`
Serialize the text attribute and its children.

Parameters
write | `callable`, taking one `str` argument, called to output a single text attribute at a time.
attrs | A formatting state instance used to determine how to serialize the attribute children.
attributeRenderer:`str` | Name of the method on attrs that should be called to render the attributes during serialization. Defaults to `'toVT102'`.

compareAttributes: `ClassVar[Sequence[str]]` = (source)
overrides `twisted.python.util.FancyEqMixin.compareAttributes`
overridden in `twisted.python._textattributes._ColorAttr`, `twisted.python._textattributes._OtherAttr`

Undocumented

children: `list` = (source)
Child attributes.