Hi,
in a project I'm overloading a lot of comparison and arithmetic
operators to make them working with more complex classes that I
defined.

Sometimes I need a different behavior of the operator depending on the
argument. For example, if I compare a object with an int, I get a
result, but if I compare the same object with a string, or another
object, I get another result.

What is the best way to do this? Shall I use a lot of "if...elif"
statements inside the overloaded operator? Or is there a more pythonic
and dynamic way?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to