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