[Python-Dev] f-strings in the grammar

2021-09-20 Thread Pablo Galindo Salgado
Hi, I have started a project to move the parsing off-strings to the parser and the grammar. Appart from some maintenance improvements (we can drop a considerable amount of hand-written code), there are some interesting things we **could** (emphasis on could) get out of this and I wanted to

Re: [Python-Dev] f-strings

2017-12-21 Thread Stephen J. Turnbull
Eric Fahlgren writes: > On Tue, Dec 19, 2017 at 8:47 AM, Stephen J. Turnbull < > turnbull.stephen...@u.tsukuba.ac.jp> wrote: > > > If I were Bach, I'd compose a more-itertools-like module to be named > > Variations_on_the_F_String. :-) > > > > Would that be P.D.Q. Bach to whom you are

Re: [Python-Dev] f-strings

2017-12-19 Thread Eric Fahlgren
On Tue, Dec 19, 2017 at 8:47 AM, Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > If I were Bach, I'd compose a more-itertools-like module to be named > Variations_on_the_F_String. :-) > ​Would that be P.D.Q. Bach to whom you are referring?​

Re: [Python-Dev] f-strings

2017-12-19 Thread Chris Barker
On Tue, Dec 19, 2017 at 8:47 AM, Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > I don't see any reason not to document tips and tricks with f-strings, > and this is a nice and useful example. But it looks like TOOWTDI to > me. The syntax is documented (6.1.3.1 in the

Re: [Python-Dev] f-strings

2017-12-19 Thread Stephen J. Turnbull
Mariatta Wijaya writes: > I agree it's useful info :) > > I went ahead and made a PR [1]. > In my PR, I simply linked to the Format Specification Mini Language[2] from > f-strings documentation[3]. > > Not sure about updating PEP 498 at this point.. I don't see any reason not to document

Re: [Python-Dev] f-strings

2017-12-15 Thread Wagner Herculano
, Wagner Herculano. From: Chris Barker - NOAA Federal <chris.bar...@noaa.gov> Sent: Friday, December 15, 2017 2:49:08 PM To: Mariatta Wijaya Cc: Wagner Herculano; Python Dev Subject: Re: [Python-Dev] f-strings That's covered under "format specifiers"

Re: [Python-Dev] f-strings

2017-12-15 Thread Chris Barker
On Fri, Dec 15, 2017 at 9:39 AM, Mariatta Wijaya wrote: > I agree it's useful info :) > > I went ahead and made a PR [1]. > Thanks! I added a couple comments to that PR. > Not sure about updating PEP 498 at this point.. > A little clarification text would be nice.

Re: [Python-Dev] f-strings

2017-12-15 Thread Mariatta Wijaya
I agree it's useful info :) I went ahead and made a PR [1]. In my PR, I simply linked to the Format Specification Mini Language[2] from f-strings documentation[3]. Not sure about updating PEP 498 at this point.. [1] https://github.com/python/cpython/pull/4888 [2]

Re: [Python-Dev] f-strings

2017-12-15 Thread Chris Barker - NOAA Federal
That's covered under "format specifiers" I think. The PEP mentions this: https://www.python.org/dev/peps/pep-0498/#format-specifiers I can see how a newbie might not realize that that means that f-strings use the same formatting language as the .format() method, and or where to find

Re: [Python-Dev] f-strings

2017-12-15 Thread Mariatta Wijaya
That's covered under "format specifiers" I think. The PEP mentions this: https://www.python.org/dev/peps/pep-0498/#format-specifiers That specific example is not mentioned in the docs, but there other examples of using format specifiers with f-strings.

[Python-Dev] f-strings

2017-12-15 Thread Wagner Herculano
Good evening, I'm Wagner Herculano from Brazil. I was trying to do a table exercise with number 5 and tried formatting spaces and did not find it in PEP 498 documentation. Finally I found a way, if possible, include this example in the documentation please. Below is my script with the desired