mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Checking in the code for PEP 357.
This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
This commit is contained in:
parent
9d7855076a
commit
38fff8c4e4
19 changed files with 269 additions and 150 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue