On Sat, May 28, 2011 at 14:40, Michael Katz <michaeladamk...@yahoo.com> wrote:
> Thanks for the explanation. It sounds like Python needs __rcontains__.

Not really. For the mathematical operators, there are good ways for
the operands to "know" what types they can deal with and which they
can't. For mylist.__contains__(x), it should treat all objects exactly
the same: check if it equals any item that it contains. There is no
way for it to say, "Oh, I don't know how to deal with this type, so
I'll pass it over to x.__contains__()".

A function call is the best place for this operation, not syntax.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to