Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Greg Ewing
Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs and other product failures in video form. While a phonetic play on the name YouTube, the abbreviation also colloquially means just what you

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Cameron Simpson
On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs and other product failures in video form. While a phonetic play on the

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Steven D'Aprano
On Tue, Aug 11, 2015 at 09:51:56PM +1000, Chris Angelico wrote: On Tue, Aug 11, 2015 at 5:08 PM, Cameron Simpson c...@zip.com.au wrote: On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-11 Thread Chris Angelico
On Tue, Aug 11, 2015 at 5:08 PM, Cameron Simpson c...@zip.com.au wrote: On 11Aug2015 18:07, Greg Ewing greg.ew...@canterbury.ac.nz wrote: Cameron Simpson wrote: To illustrate, there's a consumer rights TV snow here with a segment called F.U. Tube, where members of the public describe ripoffs

[Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Victor Stinner
PEP 498: Leading whitespace in expressions is skipped https://www.python.org/dev/peps/pep-0498/#id28 Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example: f'{{k:v for k, v in [(1, 2), (3, 4)]}}' '{k:v for k, v in [(1, 2), (3,

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Victor Stinner
By the way, I don't think that fu'...' syntax should be allowed. IMHO u'...' was only reintroduced to Python 3.3 to ease transition from Python 2 to Python 3 of the existing u'...' Syntax. Since f'...' is a new syntax, backward compatibility doesn't matter here. Victor

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread MRAB
On 2015-08-11 00:26, Victor Stinner wrote: Le mardi 11 août 2015, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com a écrit : It sounds like you want to disallow leading spaces just to disallow this one type of expression. I would like to reduce the number of subtle

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread MRAB
On 2015-08-10 23:54, Victor Stinner wrote: PEP 498: Leading whitespace in expressions is skipped https://www.python.org/dev/peps/pep-0498/#id28 Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example: f'{{k:v for k,

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Eric V. Smith
On 8/10/2015 7:26 PM, Victor Stinner wrote: Le mardi 11 août 2015, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com a écrit : It sounds like you want to disallow leading spaces just to disallow this one type of expression. I would like to reduce the number of subtle

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Eric V. Smith
On 8/10/2015 8:04 PM, Victor Stinner wrote: Le mardi 11 août 2015, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com a écrit : I'm a little bit surprised at seeing this: (...) We may modify str.format to ignore leading spaces, but IMHO it should not be motivated

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Eric V. Smith
On 8/10/2015 6:54 PM, Victor Stinner wrote: PEP 498: Leading whitespace in expressions is skipped https://www.python.org/dev/peps/pep-0498/#id28 Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example:

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Victor Stinner
Le mardi 11 août 2015, Eric V. Smith e...@trueblade.com a écrit : It sounds like you want to disallow leading spaces just to disallow this one type of expression. I would like to reduce the number of subtle differences between f-string and str.format(). Victor

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Cameron Simpson
On 11Aug2015 01:00, Victor Stinner victor.stin...@gmail.com wrote: By the way, I don't think that fu'...' syntax should be allowed. IMHO u'...' was only reintroduced to Python 3.3 to ease transition from Python 2 to Python 3 of the existing u'...' Syntax. Since f'...' is a new syntax, backward

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Victor Stinner
Le mardi 11 août 2015, MRAB pyt...@mrabarnett.plus.com a écrit : I'm a little bit surprised at seeing this: (...) We may modify str.format to ignore leading spaces, but IMHO it should not be motivated by the PEP. Victor ___ Python-Dev mailing list

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread Eric V. Smith
On 8/10/2015 8:00 PM, MRAB wrote: On 2015-08-11 00:26, Victor Stinner wrote: Le mardi 11 août 2015, Eric V. Smith e...@trueblade.com mailto:e...@trueblade.com a écrit : It sounds like you want to disallow leading spaces just to disallow this one type of expression. I would like