Steven D'Aprano <[EMAIL PROTECTED]> wrote:

> I thought that an iterator was any object that follows the iterator
> protocol, that is, it has a next() method and an __iter__() method.

The special methods need to be on the type -- having attributes of those
names on the instance doesn't help (applies to all special methods in
the normal, aka newstyle, object model; legacy, aka classic, classes,
work by slightly different and not entirely self-consistent semantics).


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to