Good ideas, however not robust: a = 1 b = 1 print(id(a)) # 4536318072 print(id(b)) # 4536318072
> On 14 Sep 2023, at 16:35, Jonathan Fine <[email protected]> wrote: > > POSTSCRIPT > > We can also use locals() to 'inverse search' to get the name, much as in the > original post. > > >>> locals()['x'] > (0, 1, 2, 3) > >>> id(x) > 139910226553296 > >>> id(locals()['x']) > 139910226553296 > -- > 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/MPPLJ6MXZDNA7J75T7H76LNYZGHCEG37/ > Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ 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/7BXP63XG4PSQ2YFLCRXUEXJNNIQYEB4H/ Code of Conduct: http://python.org/psf/codeofconduct/
