Eric V. Smith <e...@trueblade.com> added the comment:
I agree with Serhiy that !s solves the problem. But as a convenience it might be nice to add __format__. This issue pops up from time to time on Path and other types, and I don't think !s is very discoverable. Especially because formatting works with a specifier, but fails with one: >>> format(path) '/path/to/enlightenment' >>> format(path, '>50') Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported format string passed to PosixPath.__format__ ---------- nosy: +eric.smith _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38222> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com