Pre-PEP: reverse iteration methods

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Wed Sep 24 02:21:02 EDT 2003


On Wed, 24 Sep 2003 02:13:48 GMT, "Andrew Dalke"
<adalke at mindspring.com> wrote:

>> Frankly, I prefer the notion of a method.
>
>While I don't.

To me, the reason to use a method (or property) is simply that most
types cannot be efficiently 'backwardised'. For instance, iterators in
general would have to be buffered into a list an then the resulting
list iterated backwards. That could be useful, but the overhead is
sufficient that I think explicitly writing 'list (x).backward ()'
rather than 'x.backward ()' would be a good thing.

Having a method (or property) explicitly associates it with the
object/class being handled.


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list