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 wrote: > > On 11Aug2015 18:07, Greg Ewing wrote: > >> > >> Cameron Simpson wrote: > >>> > >>> To illustrate, there's a consumer rights TV snow here with a segment > >>> called "F.U.

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 wrote: > On 11Aug2015 18:07, Greg Ewing 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 fail

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 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 name "YouTube", the abbrevi

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

2015-08-10 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

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 > 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. Agr

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 > > a écrit : >> >> It sounds like you want to disallow leading spaces just to >> disallow this one type of expression. >> >> >> I would like t

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 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 Python-Dev@python.org htt

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 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 differences between f-str

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 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 compatibility doesn't matt

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 > 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

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 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 MRAB
On 2015-08-10 23:54, Victor Stinner wrote: PEP 498: """ Leading whitespace in expressions is skipped Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example: f'{{k:v fo

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 > > > Because expressions may begin with a left brace ('{'), there is a > problem when parsing such expressions. For

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

[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 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), (