Why does len() on a filter object in py3 not just materialize the result instead of raising an error that's mostly unhelpful?
I'd look at it this way: If it did what you want, then ppl reading code have to lookout for calls to len() as possibly allocating
-
-
As it is, they only have to look at list()/tuple(), etc., object constructors, as possbly allocating. easier to reason about
-
I see your point but it should be obvious that len just has to traverse the entirety of your data (absent storing the length)
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.