t.p.u.FancyStrMixin : class documentation

Part of twisted.python.util View Source View In Hierarchy

Known subclasses: twisted.names.dns._OPTHeader, twisted.names.dns._OPTVariableOption, twisted.names.dns.Record_A6, twisted.names.dns.Record_AAAA, twisted.names.dns.Record_AFSDB, twisted.names.dns.Record_HINFO, twisted.names.dns.Record_MINFO, twisted.names.dns.Record_MX, twisted.names.dns.Record_NAPTR, twisted.names.dns.Record_NULL, twisted.names.dns.Record_RP, twisted.names.dns.Record_SOA, twisted.names.dns.Record_SRV, twisted.names.dns.Record_TXT, twisted.names.dns.Record_WKS, twisted.names.dns.SimpleRecord, twisted.names.dns.UnknownRecord

Mixin providing a flexible implementation of __str__.

__str__ output will begin with the name of the class, or the contents of the attribute fancybasename if it is set.

The body of __str__ can be controlled by overriding showAttributes in a subclass. Set showAttributes to a sequence of strings naming attributes, or sequences of (attributeName, callable), or sequences of (attributeName, displayName, formatCharacter). In the second case, the callable is passed the value of the attribute and its return value used in the output of __str__. In the final case, the attribute is looked up using attributeName, but the output uses displayName instead, and renders the value of the attribute using formatCharacter, e.g. "%.3f" might be used for a float.

Method __str__ Undocumented
def __str__(self): (source)
API Documentation for Twisted, generated by pydoctor at 2013-11-08 22:07:30.