doc: mention NotImplementedError in python-comparisons.txt
commitd95717d563644af542fadd66f1ddd1d218618a21
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Sun, 6 Jul 2008 20:26:05 +0000 (7 00:26 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Sun, 6 Jul 2008 20:26:05 +0000 (7 00:26 +0400)
treeaf529d24a2259205dcac026368214483cefe9685
parentaebddb126b7ff455e13a6bb7c1f4e4636a5be338
doc: mention NotImplementedError in python-comparisons.txt

We talk about returning NotImplemented as a way to say that some method, e.g.
__lt__ is not implemented for some combination of types.

However, there exists excepttion with similar from the first glance semantics
-- NotImplementedError, and in some cases it could be tempting for users to
raise it instead of returning NotImplemented, but the fact is that

        'return NotImplemented'  !=  'raise NotImplementedError'

Python will just skip NotImplementedError with respect to choosing appropriate
comparison method, and propagate this exception upwards to the caller.

So I think we'd better warn users in the first place.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
doc/src/python-comparisons.txt