Answers for "python get object name"

0

how to get the name of an object in python

dict([(t.__name__, t) for t in fun_list])
Posted by: Guest on February-17-2021
0

python get object name

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
Posted by: Guest on October-27-2021

Code answers related to "python get object name"

Python Answers by Framework

Browse Popular Code Answers by Language