f-strings & pythonic - Simple is better than complex. - Flat is better than nested. (I think this applies) - Readability counts. - If the implementation is easy to explain, it may be a good idea.
Just saying. Cheers, Hans On 14/09/18 11:33, Chris Angelico wrote:
On Fri, Sep 14, 2018 at 7:02 PM, Hans Polak <[email protected]> wrote:I have recently updated my code to use the more pythonic f-string instead of '{}'.format()Well there's your problem right there. Don't change your string formatting choice on that basis. F-strings aren't "more Pythonic" than either .format() or percent-formatting; all three of them are supported for good reasons. For i18n, I think .format() is probably your best bet. Trying to mess with f-strings to give them methods is a path of great hairiness, as they are not actually objects (they're expressions). ChrisA _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
