[issue13804] Python library structure creates hard to read code when using higher order functions

Daniel Stutzbach report at bugs.python.org
Tue Jan 17 20:42:34 CET 2012


Daniel Stutzbach <stutzbach at google.com> added the comment:

If I'm understanding Martin Häcker's code correctly, the list comprehension equivalent is:

self.questions = [topic.questions for topic in self.topics]

The reduce() variants are not only much harder to read, but they will take O(n**2) operations because they create an O(n) list O(n) times.

----------
nosy: +stutzbach

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13804>
_______________________________________


More information about the Python-bugs-list mailing list