12 Oct
2014
12 Oct
'14
4:22 a.m.
On Fri, Oct 10, 2014, at 19:34, Andrew Barnert wrote:
The if example is a good illustration of this. If a genexpr is a sequence iff it has exactly 1 for clause and 0 if clauses
Why not 2 for clause? Won't its length always be the product of the two inputs, then? (And you forgot if its inputs are sequences) More to the point, since python isn't statically typed, there's no reason that user code would have to produce a view (though I'd suggest it should at least produce an "iterable" that next can't be called directly on without iter - a paradigm that has worked well for Java and C#) if it doesn't want to.