diff options
Diffstat (limited to 'Doc/ref')
-rw-r--r-- | Doc/ref/ref3.tex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index 5b78f1c..737b861 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -1978,6 +1978,13 @@ Called to implement the built-in functions \function{hex()}\bifuncindex{hex}. Should return a string value. \end{methoddesc} +\begin{methoddesc}[numeric object]{__index__}{self} +Called to implement operator.index(). Also called whenever Python +needs an integer object (such as in slicing). Must return an integer +(int or long). +\versionadded{2.5} +\end{methoddesc} + \begin{methoddesc}[numeric object]{__coerce__}{self, other} Called to implement ``mixed-mode'' numeric arithmetic. Should either return a 2-tuple containing \var{self} and \var{other} converted to |