Simplify utils.qualname.

This commit is contained in:
Florian Bruhin 2015-08-04 10:36:35 +02:00
parent c4183bc34d
commit c67f7b6b21

View File

@ -555,10 +555,8 @@ def qualname(obj):
else:
name = repr(obj)
if inspect.isclass(obj) or inspect.isfunction(obj):
module = obj.__module__
return "{}.{}".format(module, name)
elif inspect.ismethod(obj):
if (inspect.isclass(obj) or inspect.isfunction(obj) or
inspect.ismethod(obj)):
return "{}.{}".format(obj.__module__, name)
else:
return name