<instance of subaddress _listinherited__attrnames=__class__ __delattr__ __dict__ __dir__ __doc__ __eq__ more names omitted total __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ __weakref__ data =spam data =eggs data = hamsub more >spamsub more >as one possible improvement to address the proliferation of inherited built-in names and long values herethe following alternative for ___attrnames in file listinherited py of the book example' package groups the double-underscore names separatelyand minimizes line wrapping for large attribute valuesnotice how it escapes with %so that just one remains for the final formatting operation at the enddef __attrnames(selfindent='* )result 'unders% \ % %% \nothers% \ ('-'* indent'-'* unders [for attr in dir(self)instance dir(if attr[: ='__and attr[- :='__'skip internals unders append(attrelsedisplay str(getattr(selfattr))[: -(len(indentlen(attr))result +'% % =% \ (indentattrdisplayreturn result 'join(underswith this changethe class' test output is bit more sophisticatedbut also more concise and usablec:\codec:\python \python listinherited py <instance of subaddress unders__doc____init____module____str__ others_listinherited__attrnames=<bound method sub __attrnames of <testmixin sub insta data =spam data =eggs data = ham=spam=multiple inheritance"mix-inclasses