Status of PEP's?
Greg Ewing
greg at cosc.canterbury.ac.nz
Mon Mar 4 23:22:41 EST 2002
Fernando Pérez wrote:
>
> Let me try to organize my thoughts a bit on why I dislike this PEP so
> seriously. I have no problem with the "everything is a first-class object"
> philosophy in Python. But I feel that precisely what this pep introduces is a
> bad usage (IMO) of these ideas.
I'd also like to add this:
It's been suggested that this proposal doesn't ask us to
think of integers as being sequences, only as having
sequences implicitly associated with them.
But I don't agree. While it's certainly possible to
give any object an __iter__ method that does anything
you want, it doesn't mean you should!
To me, the __iter__ protocol is intended to be used when
an object can reasonably be thought of as a sequence.
That's actually *being* a sequence, not just "associated"
with a sequence in some way.
Using the __iter__ protocol in the way suggested by
this PEP is abusing it, in my opinion.
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list