[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-24 Thread micro codery
As pointed out already, f-strings and format are subtly different (not counting that one can eval and the other cannot). Besides quoting, the f-sting mini language has diverged from format's >>> spam="Spam" >>> f"{spam=}" "spam='Spam'" >>> "{spam=}".format(spam=spam) Traceback (most recent call las

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread micro codery
> > But it nevertheless feels like a bit of an abuse - the original point >> > of ellipsis was for indexing, and in particular complex slices like >> > a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand >> > it, >> Interesting -- do you know what ... means in that context? >> >

[Python-Dev] Re: The repr of a sentinel

2021-05-14 Thread micro codery
I think that would be the primary motivating factor behind recommending Ellipsis, it’s already a builtin and we are not likely it to get another builtin singleton. Ever? But besides that “...” in a function signature, although maybe looking magical, does immediately call out to the reader that some

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread micro codery
> There was a discussion a while back ( a year or so?? ) on Python-ideas > that introduced the idea of having more "sentinel-like" singletons in > Python -- right now, we only have None. > Not quite true, we also have Ellipsis, which already has a nice repr that both reads easily and still follows