Re:Problems I Have with Python
by ThatGeoGuy on Wednesday January 25, 2017 @01:26PM
(#13484260)
This only flattens one level. Consider the following snippets:
vs.
There's a big difference here. Flattening a list to just the elements inside isn't terribly hard, especially in a language like Scheme with tail-recursion, but flatten is definitely something that should be in the standard library. The "flatten" you propose is really just appending the elements of the first level of the list.
[ Parent
| on HN ]
Re:Problems I Have with Python
by brettcannon on Wednesday January 25, 2017 @03:35PM
(#13485755)
See https://bugs.python.org/issue27852 for a discussion as to why there isn't a more general flatten().