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

Facundo Batista facundobatista at gmail.com
Thu May 10 09:13:00 EDT 2018


> I would like to see you flesh out the idea. In particular, I'd like to see you
> address cases where:
> 1. The underlying members in the collection are not strings. Besides the basic
>    types such as numbers, it would also be nice to be able to apply formats
>    recursively so that one can construct a string using the attributes of
>    members that are objects or items or other collections.

I didn't think about this at the time. I have the feeling (not really
well thought yet) that "recursive formatting" will complicate
everything too much, that doing str() (as {} defaults to) on every
object would fulfill most of the basic cases and keep this simple.


> 2. The ability to handle collections other than simple lists or iterables, such
>    as dictionaries.

Ideally, it will handle *any* iterable.

Thanks!

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
Twitter: @facundobatista


More information about the Python-ideas mailing list