📅  最后修改于: 2022-03-11 14:45:30.268000             🧑  作者: Mango
def name_of_object(arg):
# check __name__ attribute (functions)
try:
return arg.__name__
except AttributeError:
pass
for name, value in globals().items():
if value is arg and not name.startswith('_'):
return name