Clarify that __op__ methods must return NotImplemented if they don't support the operation.

This commit is contained in:
Georg Brandl 2006-07-30 10:53:32 +00:00
parent a7edb11122
commit ad6911bd62
1 changed files with 3 additions and 0 deletions

View File

@ -1886,6 +1886,9 @@ method should be the equivalent to using \method{__floordiv__()} and
\method{__pow__()} should be defined to accept an optional third \method{__pow__()} should be defined to accept an optional third
argument if the ternary version of the built-in argument if the ternary version of the built-in
\function{pow()}\bifuncindex{pow} function is to be supported. \function{pow()}\bifuncindex{pow} function is to be supported.
If one of those methods does not support the operation with the
supplied arguments, it should return \code{NotImplemented}.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}[numeric object]{__div__}{self, other} \begin{methoddesc}[numeric object]{__div__}{self, other}