Re: [Python-ideas] Custom converters in str.format() and f-strings

2019-05-04 Thread Eric V. Smith
I think PEP 501 would be a better approach to this. Eric > On May 4, 2019, at 11:51 AM, Serhiy Storchaka wrote: > > Currently str.format() and f-strings support three converters. Converting is > specified by the "!" character followed by a letter which denotes the > converter. > > s: str()

Re: [Python-ideas] Custom converters in str.format() and f-strings

2019-05-04 Thread Steven D'Aprano
On Sat, May 04, 2019 at 06:51:39PM +0300, Serhiy Storchaka wrote: > It is less important for f-strings because you can use arbitrary > expressions, but even in this case f"Hello, {name!x}!" or f"Hello, > {name!xml}!" looks better than f"Hello, {html.escape(name)}!" or > f"Hello, {x(name)}!". h