#NEWLINE# def type_name( value ) : #NEWLINE# #INDENT# "\n    Returns a user-readable name for the type of an object\n\n    :param value:\n        A value to get the type name of\n\n    :return:\n        A unicode string of the object's type name\n    " #NEWLINE# if inspect . isclass ( value ) : #NEWLINE# #INDENT# cls = value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cls = value . __class__ #NEWLINE# #UNINDENT# if ( cls . __module__ in set ( [ 'builtins' , '__builtin__' ] ) ) : #NEWLINE# #INDENT# return cls . __name__ #NEWLINE# #UNINDENT# return ( '%s.%s' % ( cls . __module__ , cls . __name__ ) )