[Python-ideas] Re: Accessing target name at runtime

2021-10-08 Thread Chris Angelico
On Sat, Oct 9, 2021 at 10:02 AM Jeremiah Paige wrote: > > On Fri, Oct 8, 2021 at 2:30 PM Chris Angelico wrote: >> >> On Sat, Oct 9, 2021 at 6:24 AM Jeremiah Paige wrote: >> > Bellow are some examples of where I believe the reflection token would be >> > used if adopted. >> > >> > >> > >>>

[Python-ideas] Re: Accessing target name at runtime

2021-10-08 Thread Jeremiah Paige
On Fri, Oct 8, 2021 at 2:30 PM Chris Angelico wrote: > On Sat, Oct 9, 2021 at 6:24 AM Jeremiah Paige wrote: > > Bellow are some examples of where I believe the reflection token would > be used if adopted. > > > > > > >>> Point = namedtuple(<<<, 'x, y, z') > > >>> Point > > > > > > > > >>>

[Python-ideas] Re: Accessing target name at runtime

2021-10-08 Thread Chris Angelico
On Sat, Oct 9, 2021 at 6:24 AM Jeremiah Paige wrote: > Bellow are some examples of where I believe the reflection token would be > used if adopted. > > > >>> Point = namedtuple(<<<, 'x, y, z') > >>> Point > > > > >>> UUIDType = NewType(<<<, str) > >>> UUIDType > __main__.UUIDType Not very

[Python-ideas] Re: dict_items.__getitem__?

2021-10-08 Thread Christopher Barker
It really ius frustrating how often we repeat entire conversations on this list :-( But last time, one of the use cases was "get a random item from a dict", and there really is not a terribly easy (and efficient) way to do that now. Anyway, I do see the benefit of adding first() to itertools --

[Python-ideas] Accessing target name at runtime

2021-10-08 Thread Jeremiah Paige
Hello Python community, Earlier this year I put forward a proposal for decorators on variables which I felt was well received in concept, but fell flat on the syntax. One of the responses to that thread was rather than abusing the decorator, to use a new symbol to get the target of an assignment