Part of twisted.python.util View Source View In Hierarchy
__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 |