def nice_classname(obj):
 if inspect.isclass(obj):
  cls_name = obj.__name__
 else:
  cls_name = obj.__class__.__name__
 mod = inspect.getmodule(obj)
 if mod:
  name = mod.__name__
  if name.startswith('org.python.core.'):
   name = name[len('org.python.core.'):]
  return ('%s.%s' % (name, cls_name))
 else:
  return cls_name

def nice_classname ( obj ) : if inspect . isclass ( obj ) : cls_name = obj . __name__ else : cls_name = obj . __class__ . __name__ mod = inspect . getmodule ( obj ) if mod : name = mod . __name__ if name . startswith ( 'org.python.core.' ) : name = name [ len ( 'org.python.core.' ) : ] return ( '%s.%s' % ( name , cls_name ) ) else : return cls_name
returns a nice name for class object or class instance .