Message76975
Doing the following (more info than necessary in case I'm doing
something weird):
def odd(n):
return n % 2
x = (1, 2, 3, 4, 5)
y = filter(odd, x)
list(y)
list(y)
Will correctly build a list from y and return [1, 3, 5] on the first
call to list(), but will return an empty list thereafter. y still
identifies itself as a filter object, but you either can't coerce it to
anything else or the value of the filter object is reset (I don't know
how to tell the difference yet).
The other container constructors (set, tuple, etc.) seem to have the
same behaviour. |
|
Date |
User |
Action |
Args |
2008-12-05 07:53:41 | kjwcode | set | recipients:
+ kjwcode |
2008-12-05 07:53:40 | kjwcode | set | messageid: <1228463620.98.0.983190950488.issue4543@psf.upfronthosting.co.za> |
2008-12-05 07:53:40 | kjwcode | link | issue4543 messages |
2008-12-05 07:53:39 | kjwcode | create | |
|