>>> and the test for an iterator is:
>>>
>>>   obj is iter(obj)

Is that a hard and fast rule? I know it’s the vast majority of cases,
but I imagine you could make an object that behaved exactly like an
iterator, but returned some proxy object rather that itself.

Not sure why one would do that, but it should be possible.

- CHB
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to