Mark Dickinson wrote:
I (still :-) think this is covered, for Python 2.x at least, by:

http://docs.python.org/reference/datamodel.html#coercion-rules

But this isn't coercion! :-)

- For objects x and y, first x.__op__(y) is tried. If this is not
implemented or returns NotImplemented, y.__rop__(x) is tried.

Also, the above is not so:

Python 2.5.1
>>> class X:
...   def __eq__(self,other):
...     print "X __eq__"
>>> class Z: pass
...
>>> Z()==X()
X __eq__

No __req__ in sight...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to