Re: [Python-ideas] Fwd: Fwd: Fwd: unpacking generalisations for list comprehension

Oct. 16, 2016
2:35 a.m.
On Oct 15, 2016 6:42 PM, "Steven D'Aprano" <steve@pearwood.info> wrote: list comps: This thread is a lot of work to try to save 8 characters in the spelling of `flatten(it)`. Let's just use the obvious and intuitive spelling. We really don't need to be Perl. Folks who want to write Perl have a perfectly good interpreter available already. The recipes in itertools give a nice implementation: def flatten(listOfLists): "Flatten one level of nesting" return chain.from_iterable(listOfLists)
3076
Age (days ago)
3076
Last active (days ago)
0 comments
1 participants
participants (1)
-
David Mertz