f-string

Chris Angelico rosuav at gmail.com
Tue Dec 5 20:21:50 EST 2017


On Wed, Dec 6, 2017 at 11:54 AM, John Pote <johnpote at jptechnical.co.uk> wrote:
>
> On 06/12/2017 00:16, Steve D'Aprano wrote:
>>
>> Anyone got a handy copy of Python 3.6 available to test something for me?
>>
>> What does compile('f"{spam} {eggs}"', '', 'single') return?
>>
>> What does eval()'ing the above compiled object do? If necessary, you may
>> have
>> to define spam and eggs first.
>
> SPAM scrambled
>
> Py version on Win 7 box
> Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit
> (AMD64)] on win32
>
> Any help?

I think Steve just wanted to see what we'd all define spam and eggs as.

ChrisA
*ducking for cover*



More information about the Python-list mailing list