On 9 May 2018 at 09:39, Facundo Batista <facundobati...@gmail.com> wrote: > This way, I could do: > >>>> authors = ["John", "Mary", "Estela"] >>>> "Authors: {:, j}".format(authors) > 'Authors: John, Mary, Estela'
+1. I bit concerned about the relevant whitespace in there, but just a little bit - it is already inside a string-literal anyway. > > In this case the join can be made in the format yes, but this proposal > would be very useful when the info to format comes inside a structure > together with other stuff, like... > >>>> info = { > ... 'title': "A book", > ... 'price': Decimal("2.34"), > ... 'authors: ["John", "Mary", "Estela"], > ... } > ... >>>> print("{title!r} (${price}) by {authors:, j}".format(**info)) > "A book" ($2.34) by John, Mary, Estela > > What do you think? > > -- > . Facundo > _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/