Author eric.smith
Recipients Allie Fitter, a.badger, eric.smith
Date 2019-05-09.17:44:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557423862.08.0.757029024832.issue36310@roundup.psfhosted.org>
In-reply-to
Content
Thanks for adding me, Toshio.

    foo = f'{_(f"{first}, bar, and {last}")}'

Wow, that's extremely creative.

I agree that this isn't the best we can do. PEP 501 has some ideas, but it might be too general purpose and powerful for this. Let me think about the nested f-string above and see if I can't think of a better way.

As an aside, this code:

foo = _("{first}, bar, and {last}").format(**globals())

Is better written with format_map():

foo = _("{first}, bar, and {last}").format_map(globals())

It does not create a new dict like the ** version does.
History
Date User Action Args
2019-05-09 17:44:22eric.smithsetrecipients: + eric.smith, a.badger, Allie Fitter
2019-05-09 17:44:22eric.smithsetmessageid: <1557423862.08.0.757029024832.issue36310@roundup.psfhosted.org>
2019-05-09 17:44:22eric.smithlinkissue36310 messages
2019-05-09 17:44:21eric.smithcreate