[Python-ideas] Add list.join() please
mertz at gnosis.cx
Tue Jan 29 22:46:11 EST 2019
Of course not! The request was for something that worked on Python
*collections*. If the OP wanted something that worked on iterables in
general, we'd need a different function with different behavior.
Of course, it also doesn't work on dictionaries. I don't really have any
ideas what the desired behavior might be for dicts. Various things are
conceivable, none obvious. But it's fine on lists, sets, tuples, deques,
and some other things that are roughly sequence-like.
On Tue, Jan 29, 2019, 10:38 PM Robert Vanden Eynde <robertve92 at gmail.com
> stringify = lambda it: type(it)(map(str, it))
> stringify(range(5)) doesn't work ^^
> One advantage or having a standard function is that it has been designed
> by a lot of persons for all possible use cases :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas