Re: [Python-ideas] Escaped braces in format specifiers

2018-05-19 Thread Ken Kundert
On Sat, May 19, 2018 at 07:06:41AM -0400, Eric V. Smith wrote: > On 5/19/2018 1:56 AM, Ken Kundert wrote: > >On Tue, May 15, 2018 at 04:23:26PM -0400, Eric V. Smith wrote: > >>I'm busy at the sprints, so I don't have a lot of time to think about this. > >> > >>However, let me just say that recursiv

Re: [Python-ideas] Escaped braces in format specifiers

2018-05-19 Thread Eric V. Smith
On 5/19/2018 1:56 AM, Ken Kundert wrote: On Tue, May 15, 2018 at 04:23:26PM -0400, Eric V. Smith wrote: I'm busy at the sprints, so I don't have a lot of time to think about this. However, let me just say that recursive format specs are supported, to a depth of 1. width=10 f'{"test":{width}}'

Re: [Python-ideas] Escaped braces in format specifiers

2018-05-18 Thread Ken Kundert
On Tue, May 15, 2018 at 04:23:26PM -0400, Eric V. Smith wrote: > I'm busy at the sprints, so I don't have a lot of time to think about this. > > However, let me just say that recursive format specs are supported, > to a depth of 1. > > >>> width=10 > >>> f'{"test":{width}}' > 'test ' > > So

Re: [Python-ideas] Escaped braces in format specifiers

2018-05-17 Thread Eric V. Smith
> On May 17, 2018, at 9:56 AM, Nick Coghlan wrote: > >> On 15 May 2018 at 16:23, Eric V. Smith wrote: >> I'm busy at the sprints, so I don't have a lot of time to think about this. >> >> However, let me just say that recursive format specs are supported, to a >> depth of 1. >> >> >>> width=1

Re: [Python-ideas] Escaped braces in format specifiers

2018-05-17 Thread Nick Coghlan
On 15 May 2018 at 16:23, Eric V. Smith wrote: > I'm busy at the sprints, so I don't have a lot of time to think about this. > > However, let me just say that recursive format specs are supported, to a > depth of 1. > > >>> width=10 > >>> f'{"test":{width}}' > 'test ' > > So first the string

Re: [Python-ideas] Escaped braces in format specifiers

2018-05-15 Thread Eric V. Smith
I'm busy at the sprints, so I don't have a lot of time to think about this. However, let me just say that recursive format specs are supported, to a depth of 1. >>> width=10 >>> f'{"test":{width}}' 'test ' So first the string is basically expanded to: f'{"test":10}' Then the string is fo

[Python-ideas] Escaped braces in format specifiers

2018-05-14 Thread Ken Kundert
The syntax for formatted string literals is given here: https://docs.python.org/3/reference/lexical_analysis.html#f-strings If you were to examine this carefully, you would see that a format_spec (the part within the braces but after the colon) can be empty or it can consist of literal chara