Message341988
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. |
|
Date |
User |
Action |
Args |
2019-05-09 17:44:22 | eric.smith | set | recipients:
+ eric.smith, a.badger, Allie Fitter |
2019-05-09 17:44:22 | eric.smith | set | messageid: <1557423862.08.0.757029024832.issue36310@roundup.psfhosted.org> |
2019-05-09 17:44:22 | eric.smith | link | issue36310 messages |
2019-05-09 17:44:21 | eric.smith | create | |
|