Mailing List Archive

PEP 701 – Syntactic formalization of f-strings
Hi everyone,

I am very excited to share with you a PEP that Batuhan Taskaya, Lysandros
Nikolaou and myself have been working on recently: PEP 701 - PEP 701 –
Syntactic formalization of f-strings <https://peps.python.org/pep-0701/>.

We believe this will be a great improvement in both the maintainability of
CPython and the usability of f-strings.

We look forward to hearing what you think about this and to get your
feedback!

*Here is a TLDR for your convenience:*

- The PEP proposes a formalized grammar for f-strings in Python by
adding f-strings directly into the Grammar instead of using a two-pass
hand-written parser.
- This would lift some existing restrictions for f-strings that (we
believe) will improve the user experience with f-strings.
- Other benefits include:
- Reduced maintenance costs for f-string parsing code as well as
improved usability for users and library developers.
- Better error messages involving f-strings by leveraging the PEG
parser machinery.
- The proposed changes would improve the overall consistency of the
language and provide a way for alternative implementations to accurately
implement f-strings.

*** IMPORTANT: direct all discussions to the discussion thread on
discourse: https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046
<https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046>
***

Thanks a lot, everyone for your time!
Regards from rainy London,
Pablo Galindo Salgado
Re: PEP 701 – Syntactic formalization of f-strings [ In reply to ]
Great stuff! ????
Rob Cliffe

On 19/12/2022 17:59, Pablo Galindo Salgado wrote:
>
> Hi everyone,
>
> I am very excited to share with you a PEP thatBatuhan Taskaya,
> Lysandros Nikolaou and myself have been working on recently:PEP 701 -
> PEP 701 – Syntactic formalization of f-strings
> <https://peps.python.org/pep-0701/>.
>
> We believe this will be a great improvement in both the
> maintainability of CPython and the usability of f-strings.
>
> We look forward to hearing what you think about this and to get your
> feedback!
>
> *Here is a TLDR for your convenience:*
>
> * The PEP proposes a formalized grammar for f-strings in Python by
> adding f-strings directly into the Grammar instead of using a
> two-pass hand-written parser.
> * This would lift some existing restrictions for f-strings that (we
> believe) will improve the user experience with f-strings.
> * Other benefits include:
> o Reduced maintenance costs for f-string parsing code as well as
> improved usability for users and library developers.
> o Better error messages involving f-strings by leveraging the
> PEG parser machinery.
> o The proposed changes would improve the overall consistency of
> the language and provide a way for alternative implementations
> to accurately implement f-strings.
>
> *** IMPORTANT: direct all discussions to the discussion thread on
> discourse:
> https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046
> ***
>
> Thanks a lot, everyone for your time!
>
> Regards from rainy London,
> Pablo Galindo Salgado
>
> _______________________________________________
> Python-Dev mailing list --python-dev@python.org
> To unsubscribe send an email topython-dev-leave@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived athttps://mail.python.org/archives/list/python-dev@python.org/message/IU4O3GFGWJ4FWXXC2TVB4CNPZI3KFBQM/
> Code of Conduct:http://python.org/psf/codeofconduct/
Re: PEP 701 – Syntactic formalization of f-strings [ In reply to ]
Hi everyone,

For those that are not following the discussion in the discourse thread, I
am holding a poll to get an idea of the community opinions on how quotes
should work in nested f-strings for PEP 701:

https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046/24

For us is very important to have everyone represented and every opinion
heard and taken into consideration so feel free to vote in the poll leaving
your opinion. But please, **read first the PEP and the previous
discussion**. This is very important to get the context and previous
arguments in favour and against the different options.

Thanks a lot for your help!

Regards from cloudy London,
Pablo Galindo Salgado

On Mon, 19 Dec 2022 at 17:59, Pablo Galindo Salgado <pablogsal@gmail.com>
wrote:

> Hi everyone,
>
> I am very excited to share with you a PEP that Batuhan Taskaya, Lysandros
> Nikolaou and myself have been working on recently: PEP 701 - PEP 701 –
> Syntactic formalization of f-strings <https://peps.python.org/pep-0701/>.
>
> We believe this will be a great improvement in both the maintainability of
> CPython and the usability of f-strings.
>
> We look forward to hearing what you think about this and to get your
> feedback!
>
> *Here is a TLDR for your convenience:*
>
> - The PEP proposes a formalized grammar for f-strings in Python by
> adding f-strings directly into the Grammar instead of using a two-pass
> hand-written parser.
> - This would lift some existing restrictions for f-strings that (we
> believe) will improve the user experience with f-strings.
> - Other benefits include:
> - Reduced maintenance costs for f-string parsing code as well as
> improved usability for users and library developers.
> - Better error messages involving f-strings by leveraging the PEG
> parser machinery.
> - The proposed changes would improve the overall consistency of the
> language and provide a way for alternative implementations to accurately
> implement f-strings.
>
> *** IMPORTANT: direct all discussions to the discussion thread on
> discourse: https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046
> <https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046>
> ***
>
> Thanks a lot, everyone for your time!
> Regards from rainy London,
> Pablo Galindo Salgado
>