On 05/10/2007 11:34, Paul Hankin wrote:
> Lists aren't copied when they're yielded,
Duh! Thanks for your sharp eye.
--
Joost Cassee
http://joost.cassee.net
--
http://mail.python.org/mailman/listinfo/python-list
Hello all,
I bumped into an unexpected problem using generators. Consider this code:
def test(s):
return _test([], [], s)
def _test(s1, s2, s):
if s:
s1.append(s.pop())
for x in _test(s1, s2, s):
yield x
s2.append(s1.pop())
for x in _test(s1, s
On Oct 5, 10:23 am, Joost Cassee <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I bumped into an unexpected problem using generators. Consider this code:
>
> def test(s):
> return _test([], [], s)
> def _test(s1, s2, s):
> if s:
> s1.append(s.pop())
> for x in _test(s1, s2, s):