mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Naming consumers that are classmethods (#324)
This commit is contained in:
parent
7de6ff17d6
commit
b62ea7dd0a
|
@ -13,9 +13,11 @@ def name_that_thing(thing):
|
|||
return name_that_thing(thing.im_class) + "." + thing.im_func.func_name
|
||||
# Other named thing
|
||||
if hasattr(thing, "__name__"):
|
||||
if hasattr(thing, "__class__") and not isinstance(thing, types.FunctionType):
|
||||
if hasattr(thing, "__class__") and not isinstance(thing, (types.FunctionType, types.MethodType)):
|
||||
if thing.__class__ is not type:
|
||||
return name_that_thing(thing.__class__)
|
||||
if hasattr(thing, "__self__"):
|
||||
return "%s.%s" % (thing.__self__.__module__, thing.__self__.__name__)
|
||||
if hasattr(thing, "__module__"):
|
||||
return "%s.%s" % (thing.__module__, thing.__name__)
|
||||
# Generic instance of a class
|
||||
|
|
Loading…
Reference in New Issue
Block a user