Oct-18-2019, 11:23 AM
There is an almost working code.
b
(it shoul be a)
def name(obj, callingLocals=locals()): for k, v in list(callingLocals.items()): if v is obj: nm = k print(nm)It's not working properly in this case:
a=3 b=3 name(a)The result is
b
(it shoul be a)