2010/1/25 Ɓukasz Rekucki <[email protected]>:
> No, cause what the snippet does is: *not B.__lt__(A)* which is
> mathematicly correct and doesn't require A to implement anything.

Yes, sorry, it's when you do a > b the problem arises.

1. a > b first tries a.__gt__(b)
2. b.__gt__(b) in turn does  b < a
3. Python's first attempt of b < a is calling b.__lt__(a)
4. but b.__lt__(a) returns NotImplemented
5. Python then tries the opposite, which is a.__gt__(b)
6. Goto 2

Infinite recursion.
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to