This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kjwcode
Recipients kjwcode
Date 2008-12-05.07:53:39
SpamBayes Score 0.00019894181
Marked as misclassified No
Message-id <1228463620.98.0.983190950488.issue4543@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-12-05 07:53:41kjwcodesetrecipients: + kjwcode
2008-12-05 07:53:40kjwcodesetmessageid: <1228463620.98.0.983190950488.issue4543@psf.upfronthosting.co.za>
2008-12-05 07:53:40kjwcodelinkissue4543 messages
2008-12-05 07:53:39kjwcodecreate