[Python-ideas] Have a "j" format option for lists

Serhiy Storchaka storchaka at gmail.com
Thu May 10 14:40:32 EDT 2018

09.05.18 15:39, Facundo Batista пише:
>>>> authors = ["John", "Mary", "Estela"]
>>>> "Authors: {:, j}".format(authors)
> 'Authors: John, Mary, Estela'

In the case of the list of book or article authors it would be better to 
get "John, Mary and Estela" or "John, Mary, and Estela". In other cases 
"John, Mary & Estela" can be more appropriate.

I mean that in real case you will need to use an external function that 
implements more complex algorithm for formatting a list.

More information about the Python-ideas mailing list