brendon zhang <[email protected]> added the comment:
update 2:
This affects ALL functions which exhaust a generator expression. If that
generator expression makes a recursive call, then the cost of evaluating it is
O(depth), when it should be only O(1).
You can see demonstrate that this doesn't just affect builtins, by replacing
max() with a custom implementation such as,
def custommax(it):
best = -9999999
for x in it:
if x > best:
best = x
return best
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40225>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com