2011/4/20 Stefan Behnel :
> Vitja Makarov, 20.04.2011 12:51:
>>
>> 2011/4/20 Stefan Behnel:
>>>
>>> Vitja Makarov, 20.04.2011 11:50:
2011/4/20 Stefan Behnel:
>
> Vitja Makarov, 20.04.2011 10:26:
>>
>> 2011/4/18 Stefan Behnel:
>>>
>>> generators have their own lifet
Vitja Makarov, 20.04.2011 12:51:
2011/4/20 Stefan Behnel:
Vitja Makarov, 20.04.2011 11:50:
2011/4/20 Stefan Behnel:
Vitja Makarov, 20.04.2011 10:26:
2011/4/18 Stefan Behnel:
generators have their own lifetime frame in CPython, and
exceptions don't leak from that. So, whenever it's the ge
2011/4/20 Stefan Behnel :
> Vitja Makarov, 20.04.2011 11:50:
>>
>> 2011/4/20 Stefan Behnel:
>>>
>>> Vitja Makarov, 20.04.2011 10:26:
2011/4/18 Stefan Behnel:
>
> generators have their own lifetime frame in CPython, and
> exceptions don't leak from that. So, whenever it's the g
Vitja Makarov, 20.04.2011 11:50:
2011/4/20 Stefan Behnel:
Vitja Makarov, 20.04.2011 10:26:
2011/4/18 Stefan Behnel:
generators have their own lifetime frame in CPython, and
exceptions don't leak from that. So, whenever it's the generator (or code
called by it) that raises an exception, that mu
2011/4/20 Stefan Behnel :
> Vitja Makarov, 20.04.2011 10:26:
>>
>> 2011/4/18 Stefan Behnel:
>>>
>>> Vitja Makarov, 18.04.2011 06:38:
2011/4/18 Stefan Behnel:
>
> Vitja Makarov, 17.04.2011 17:57:
>>
>> 3. check_yield_in_exception()
>
> I added this because I found a
Vitja Makarov, 20.04.2011 10:26:
2011/4/18 Stefan Behnel:
Vitja Makarov, 18.04.2011 06:38:
2011/4/18 Stefan Behnel:
Vitja Makarov, 17.04.2011 17:57:
3. check_yield_in_exception()
I added this because I found a failing pyregr test that uses it (testing
the
@contextmanager decorator).
C
2011/4/18 Stefan Behnel :
> Vitja Makarov, 18.04.2011 06:38:
>>
>> 2011/4/18 Stefan Behnel:
>>>
>>> Vitja Makarov, 17.04.2011 17:57:
3. check_yield_in_exception()
>>>
>>> I added this because I found a failing pyregr test that uses it (testing
>>> the
>>> @contextmanager decorator).
>>>
>
2011/4/19 Stefan Behnel :
> Vitja Makarov, 18.04.2011 15:19:
>>
>> There is one more interesting thing:
>>
>> def test_yield_inside_genexp():
>> """
>> >>> o = test_yield_inside_genexp()
>> >>> list(o)
>> [0, None, 1, None, 2, None]
>> """
>> return ((yield i) for i in ran
Vitja Makarov, 18.04.2011 15:19:
There is one more interesting thing:
def test_yield_inside_genexp():
"""
>>> o = test_yield_inside_genexp()
>>> list(o)
[0, None, 1, None, 2, None]
"""
return ((yield i) for i in range(3))
Impressively ugly.
I guess we should st
2011/4/18 Stefan Behnel :
> Vitja Makarov, 18.04.2011 06:38:
>>
>> 2011/4/18 Stefan Behnel:
>>>
>>> Vitja Makarov, 17.04.2011 17:57:
3. check_yield_in_exception()
>>>
>>> I added this because I found a failing pyregr test that uses it (testing
>>> the
>>> @contextmanager decorator).
>>>
>
Vitja Makarov, 18.04.2011 06:38:
2011/4/18 Stefan Behnel:
Vitja Makarov, 17.04.2011 17:57:
3. check_yield_in_exception()
I added this because I found a failing pyregr test that uses it (testing the
@contextmanager decorator).
Cython calls __Pyx_ExceptionReset when except block is done, so
2011/4/18 Stefan Behnel :
> Vitja Makarov, 17.04.2011 17:57:
>>
>> 3. check_yield_in_exception()
>
> I added this because I found a failing pyregr test that uses it (testing the
> @contextmanager decorator).
>
>
>> Cython calls __Pyx_ExceptionReset when except block is done, so when
>> yield is the
Vitja Makarov, 17.04.2011 17:57:
3. check_yield_in_exception()
I added this because I found a failing pyregr test that uses it (testing
the @contextmanager decorator).
Cython calls __Pyx_ExceptionReset when except block is done, so when
yield is there no exception reset is called.
I'm not
Hi!
1. Lambda-generator:
Previous implementation was inspired by Python2.6:
>>> list((lambda:((yield 1), (yield 2)))())
[1, 2, (None, None)]
things changed in python2.7:
>>> list((lambda:((yield 1), (yield 2)))())
[1, 2]
2. GeneratorExit is initialized to StopIteration when running
generators_p
14 matches
Mail list logo