A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068957.html below:

[Python-Dev] Suggestion for a new built-in

[Python-Dev] Suggestion for a new built-in - flatten [Python-Dev] Suggestion for a new built-in - flattenRaymond Hettinger rhettinger at ewtllc.com
Fri Sep 22 22:14:58 CEST 2006
[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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4