Comment on PEP-0322: Reverse Iteration Methods

sebastien s.keim at
Fri Sep 26 09:35:29 CEST 2003

"Raymond Hettinger" <vze4rx4y at> wrote in message news:<wCGcb.3064$yU5.2141 at>...

> If you have a magic method, __riter__, then the corresponding
> function needs to be a builtin.  They go hand in hand.  The
> core parts of the language need to be usable without having
> to know about itertools.

I don't think so:
We already have this situation for the the copy module:
copy.copy() use the __copy__ magic method and copy.deepcopy() use
I've never heard about problems with this behaviour.

In fact it's not the __riter__ magic method which will use riter()
function but the opposite, so an object which define __riter__ doesn't
need to now anything about riter().

More information about the Python-list mailing list