def print_attr_values( thing, all=False, heading=None, file=None ):
if heading :<EOL><INDENT>if isinstance( heading, int ) :<EOL><INDENT>heading = '<STR_LIT>'.format(<EOL>'<STR_LIT:all>' if all else '<STR_LIT>',<EOL>getattr( thing, '<STR_LIT>', str(thing) )<EOL>)<EOL><DEDENT>print( heading, file=file )<EOL><DEDENT>for attr in object_attributes( thing, all ):<EOL><INDENT>attr_value = getattr( thing, attr )<EOL>if attr_value is not None :<EOL><INDENT>print( attr, '<STR_LIT::>', attr_value, file=file )<EOL><DEDENT>elif all :<EOL><INDENT>print( attr, '<STR_LIT::>' )<EOL><DEDENT><DEDENT>
Print the attributes of thing which have non-empty values,
as a vertical list of "name : value". When all=True, print
all attributes even those with empty values.