recurses to superclasses explicitlyuses str format(for clarity__module__=__main__ __str__this test' output is much larger in and may justify isolating underscore names in general as we did earlier in factthis test may not even work in some currently recent releases as isc:\codec:\python \python listtree py etc file "listtree py"line in __attrnames result +spaces '{ }={ }\nformat(attrgetattr(objattr)typeerrortype method_descriptor doesn' define __format__ debated recoding to work around this issuebut it serves as fair example of debugging requirements and techniques in dynamic open source project like python per the following notethe str format call no longer supports certain object types that are the values of built-in attribute names--yet another reason these names are probably better skipped debugging str format issuein xrunning the commented-out version works in and but there seems to be bugor at least regressionhere in and --these pythons fail with an exception because five built-in methods in object do not define __format__ expected by str formatand the default in object is apparently no longer applied correctly in such cases with empty and generic formatting targets to see this liveit' enough to run simplified code that isolates the problemc:\codepy - '{ }format(object __reduce__" :\codepy - '{ }format(object __reduce__typeerrortype method_descriptor doesn' define __format__ per both prior behavior and current python documentationempty targets like this are supposed to convert the object to its str print string (see both the original pep and the language reference manualoddlythe { and { :sstring targets both now failbut the { !sforced str conversion target worksas does manual str preconversion --apparently reflecting change for type-specific case that neglected perhaps more common generic usage modesc:\codepy - '{ : }format(object __reduce__typeerrortype method_descriptor doesn' define __format__ '{ ! }format(object __reduce__" designing with classes