On Tue, 12 Sept 2023 at 19:51, Dom Grigonis <dom.grigo...@gmail.com> wrote: > > It wouldn’t. I know this is weird and not in line of how things work. This is > more about simply getting reference variable name in locals() from the > reference itself. But how would one access the variable name, when once > called it returns the object it points to, not itself. So this would > obviously require an exception in parser itself. > > a = object() > b = a > print(a.__varname__) # ‘a' > print(b.__varname__) # 'b' > print((a + b).__varname__) # Undefined??? ‘a + b’? >
I don't understand your desired semantics. Do you just want to take whatever is given and put it in quotes? ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ZWO3FPC2G2AWA5TNINBX4ZHDMKFBWQZN/ Code of Conduct: http://python.org/psf/codeofconduct/