Perhaps use the id of an object instead of its value. Here's how it might
work
>>> store = {}
>>> def wibble(fn):
... val = fn()
... name = fn.__name__
... store[id(val)] = name
... return val
>>> @wibble
... def ddd():
... return tuple(range(4))
>>> ddd
(0, 1, 2, 3)
>>> store[id(ddd)]
'ddd'
>>>
>>> x = ddd
>>> ddd = None
>>> store[id(x)]
'ddd'
I hope this helps.
--
Jonathan
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/V2RON2KVFVECTZMLXHJV3KJKNSLNQHA5/
Code of Conduct: http://python.org/psf/codeofconduct/