On 5/25/2010 1:09 PM, Terry Reedy wrote:
On 5/25/2010 3:08 AM, Peter Otten wrote:
Michele Simionato wrote:
I think not turning the list-comp into syntactic sugar for
list(genexp) in
py3 is a missed opportunity.
Implementing it that way was tried but was much slower than the current
implemen
On 5/25/2010 3:08 AM, Peter Otten wrote:
Michele Simionato wrote:
I think not turning the list-comp into syntactic sugar for list(genexp) in
py3 is a missed opportunity.
Implementing it that way was tried but was much slower than the current
implementation. If one uses StopIteration as it i
On May 25, 9:08 am, Peter Otten <__pete...@web.de> wrote:
> But the list comprehension is already non-equivalent to the for loop as the
> loop variable isn't leaked anymore. We do have three similar constructs with
> subtle differences.
>
> I think not turning the list-comp into syntactic sugar for
Michele Simionato wrote:
> On May 25, 12:47 am, Carl Banks wrote:
>> The situation here is known. It can't be corrected, even in Python 3,
>> without modifying iterator protocol to tie StopIteration to a specific
>> iterator. This is possible and might be worth it to avoid hard-to-
>> diagnose
On May 25, 12:47 am, Carl Banks wrote:
> The situation here is known. It can't be corrected, even in Python 3,
> without modifying iterator protocol to tie StopIteration to a specific
> iterator. This is possible and might be worth it to avoid hard-to-
> diagnose bugs but it would complicate ite
On Mon, 24 May 2010 15:47:32 -0700 (PDT)
Carl Banks wrote:
> >
> > Is this distinction generally known?
Yes, it is.
> > The generator expression
> > behavior is understandable since a generator would do the same thing,
> > but I'm disappointed that the inconsistency exists and wasn't fixed in
>
On May 24, 3:31 pm, Ian Kelly wrote:
> Hi all,
>
> I just ran into an interesting but rather subtle little wart today.
> The following expressions are not functionally equivalent, even in
> Python 3:
>
> tuple(iterator.next() for i in xrange(n))
>
> tuple([iterator.next() for i in xrange(n)])
>
>
Hi all,
I just ran into an interesting but rather subtle little wart today.
The following expressions are not functionally equivalent, even in
Python 3:
tuple(iterator.next() for i in xrange(n))
tuple([iterator.next() for i in xrange(n)])
In the first case, if iterator.next() raises a StopItera