[Michael Foord]
>I have a suggestion for a new Python built in function: 'flatten'.
> ...
> There are several different possible approaches in pure Python, 
> but is this an idea that has legs ?

No legs.

It has been discussed ad naseum on comp.lang.python.  People seem to
enjoy writing their own versions of flatten more than finding legitimate
use cases that don't already have trivial solutions.

A general purpose flattener needs some way to be told was is atomic and
what can be further subdivided.  Also, it not obvious how the algorithm
should be extended to cover inputs with tree-like data structures with
data at nodes as well as the leaves (preorder, postorder, inorder
traversal, etc.)

I say use your favorite cookbook approach and leave it out of the
language.


Raymond
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to