[Python-ideas] Suggested MapView object (Re: __len__() for map())

Chris Barker - NOAA Federal chris.barker at noaa.gov
Wed Dec 12 23:06:17 EST 2018

>>> 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.


More information about the Python-ideas mailing list