[Python-ideas] Re: f-string code formatting

2020-09-20 Thread Steven D'Aprano
On Fri, Sep 18, 2020 at 12:32:32PM -0400, Wes Turner wrote: > Is there a list of supported preprocessor directives or compiler directives > supported by CPython and other tools? I expect that most tools will have their own list. Python doesn't really have directives other than `from __future__ im

[Python-ideas] Re: f-strings as assignment targets

2020-09-20 Thread Stephen J. Turnbull
Greg Ewing writes: > On 20/09/20 7:45 am, Christopher Barker wrote: > > In [4]: from parse import parse > > In [5]: parse("{x}{y}{z}", a_string) > > Out[5]: > > > > In [6]: parse("{x:d}{y:d}{z:d}", a_string) > > Out[6]: > > > > So that's interesting -- different level of "greadiness" f

[Python-ideas] Re: f-strings as assignment targets

2020-09-20 Thread Wes Turner
Tests for parsers / [regex] pattern matchers in the CPython standard library: https://github.com/python/cpython/blob/master/Lib/test/test_fstring.py https://github.com/python/cpython/blob/master/Lib/test/re_tests.py https://github.com/python/cpython/blob/master/Lib/test/test_re.py https://githu

[Python-ideas] Re: f-strings as assignment targets

2020-09-20 Thread Greg Ewing
On 20/09/20 9:25 pm, Stephen J. Turnbull wrote: Are you sure that shouldn't be "I was told to expect three things, but I found six?" ;-) And why not parse a_string using the "grammar" "{x}{y}{z}" as {'x': 2345, 'y': 6, 'z': 7}? As a human I tend to expect input formats to be somewhat sensible

[Python-ideas] Re: f-strings as assignment targets

2020-09-20 Thread Wes Turner
Parsing ... Parsing natural language (s) with and without Context-Free Grammars https://en.wikipedia.org/wiki/Parsing https://en. wikipedia.org/wiki/Natural_language_processing https://en.wikipedia.org/wiki/Context-free_grammar#Undecidable_problems (*) ### NLTK https://en.wikipedia.org/wiki/Na

[Python-ideas] Naming Accepted PEPs as PAPs

2020-09-20 Thread Abdur-Rahmaan Janhangeer
Greeting lists, I am thinking of proposing to name accepted PEPs as PAPs namely: Python Accepted Proposals. Hence if we say PAP8 we know it's an accepted proposal. Backstory: I quoted V. Stinner in this for PEP 608