some random reflections of a "Python newbie": (2) language issues
Alex Martelli
alex at magenta.com
Wed Dec 15 19:07:11 EST 1999
John Skaller writes (and I focus on my sole
disagreement with his long fascinating post):
[big snip]
> > how to prototype in Python-as-it-stands
> > (not with the needed polymorphism, and
> > good performance, etc, which are the
> > whole point of the suggestion:-).
>
> The answer is to use named methods, like:
>
> x.contains(y)
>
> This works, even if the syntax is not
> exactly what you want. And it is safer, since it
Nope, this gives no _polymorphism_ whatsoever.
Fortunately, I hear that __contains__ will be
in a forthcoming version, making me a very
happy camper indeed:-).
Alex
More information about the Python-list
mailing list