[Python-ideas] Re: addition of "nameof" operator

2020-01-30 Thread Andrew Barnert via Python-ideas
On Jan 30, 2020, at 11:20, Johan Vergeer wrote: > > It is a couple of days later, but I managed to create a more expanded > proposal. > > This proposal is about having a simple and consistent way of getting the name > of an object. > Whether it is a class, type, function, method or variable

[Python-ideas] Re: Allow spaces between string prefix and the string literal

2020-01-30 Thread Steven D'Aprano
On Thu, Jan 30, 2020 at 12:39:29AM +0300, Mikhail V wrote: > I would like to see possibility to put spaces > between the string prefix and the string literal > so I could write e.g. like this: > > print (f "x: {x}") > > IMO it would help with legibility especially > noticable with by

[Python-ideas] Re: Allow spaces between string prefix and the string literal

2020-01-30 Thread Brett Cannon
The problem is that's ambiguous to the grammar whether you truly mean 'f' as a prefix or 'f' as a variable and just happened to type something wrong. And then debugging that would be horrible. So even if the grammar to support it, I'm -1 on the idea. On Wed, Jan 29, 2020 at 1:41 PM Mikhail V

[Python-ideas] Re: addition of "nameof" operator

2020-01-30 Thread Johan Vergeer
It is a couple of days later, but I managed to create a more expanded proposal. This proposal is about having a simple and consistent way of getting the name of an object. Whether it is a class, type, function, method or variable or any other object. # Why? ## Usage in strings The first