list() coercion
Ian Bicking
ianb at colorstudy.com
Wed Jul 16 23:56:02 EDT 2003
On Wed, 2003-07-16 at 22:04, Greg Ewing (using news.cis.dfn.de) wrote:
> Ian Bicking wrote:
> > However, list() seems to call the object's
> > __len__,
> >
> > Is there a way I can keep this from happening?
>
> Give your object an __iter__ method that returns
> itself.
I'm not clear on how that will help...?
It already does have an __iter__ method, but it returns a separate
iterator.
Ian
More information about the Python-list
mailing list