Why does len() on a filter object in py3 not just materialize the result instead of raising an error that's mostly unhelpful?
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)
-
also an efficient len needn't actually allocate more than 1 item vs casting to list /actually/ makes me waste all that memory
- 5 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.