Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b894370

Browse files
committed
Fixed some index entries.
In the __coerce__ description, None should be returned if the conversion is *impossible*, not *possible*. Reported by Robert Kern <[email protected]>.
1 parent 2697694 commit b894370

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

Doc/ref/ref3.tex

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,18 +1130,18 @@ \subsection{Emulating numeric types\label{numeric-types}}
11301130
particular kind of number implemented (e.g., bitwise operations for
11311131
non-integral numbers) should be left undefined.
11321132

1133-
\begin{methoddesc}[numeric interface]{__add__}{self, other}
1134-
\methodline{__sub__}{self, other}
1135-
\methodline{__mul__}{self, other}
1136-
\methodline{__div__}{self, other}
1137-
\methodline{__mod__}{self, other}
1138-
\methodline{__divmod__}{self, other}
1139-
\methodline{__pow__}{self, other\optional{, modulo}}
1140-
\methodline{__lshift__}{self, other}
1141-
\methodline{__rshift__}{self, other}
1142-
\methodline{__and__}{self, other}
1143-
\methodline{__xor__}{self, other}
1144-
\methodline{__or__}{self, other}
1133+
\begin{methoddesc}[numeric object]{__add__}{self, other}
1134+
\methodline[numeric object]{__sub__}{self, other}
1135+
\methodline[numeric object]{__mul__}{self, other}
1136+
\methodline[numeric object]{__div__}{self, other}
1137+
\methodline[numeric object]{__mod__}{self, other}
1138+
\methodline[numeric object]{__divmod__}{self, other}
1139+
\methodline[numeric object]{__pow__}{self, other\optional{, modulo}}
1140+
\methodline[numeric object]{__lshift__}{self, other}
1141+
\methodline[numeric object]{__rshift__}{self, other}
1142+
\methodline[numeric object]{__and__}{self, other}
1143+
\methodline[numeric object]{__xor__}{self, other}
1144+
\methodline[numeric object]{__or__}{self, other}
11451145
These functions are
11461146
called to implement the binary arithmetic operations (\code{+},
11471147
\code{-}, \code{*}, \code{/}, \code{\%},
@@ -1156,18 +1156,18 @@ \subsection{Emulating numeric types\label{numeric-types}}
11561156
\function{pow()}\bifuncindex{pow} function is to be supported.
11571157
\end{methoddesc}
11581158

1159-
\begin{methoddesc}[numeric interface]{__radd__}{self, other}
1160-
\methodline{__rsub__}{self, other}
1161-
\methodline{__rmul__}{self, other}
1162-
\methodline{__rdiv__}{self, other}
1163-
\methodline{__rmod__}{self, other}
1164-
\methodline{__rdivmod__}{self, other}
1165-
\methodline{__rpow__}{self, other}
1166-
\methodline{__rlshift__}{self, other}
1167-
\methodline{__rrshift__}{self, other}
1168-
\methodline{__rand__}{self, other}
1169-
\methodline{__rxor__}{self, other}
1170-
\methodline{__ror__}{self, other}
1159+
\begin{methoddesc}[numeric object]{__radd__}{self, other}
1160+
\methodline[numeric object]{__rsub__}{self, other}
1161+
\methodline[numeric object]{__rmul__}{self, other}
1162+
\methodline[numeric object]{__rdiv__}{self, other}
1163+
\methodline[numeric object]{__rmod__}{self, other}
1164+
\methodline[numeric object]{__rdivmod__}{self, other}
1165+
\methodline[numeric object]{__rpow__}{self, other}
1166+
\methodline[numeric object]{__rlshift__}{self, other}
1167+
\methodline[numeric object]{__rrshift__}{self, other}
1168+
\methodline[numeric object]{__rand__}{self, other}
1169+
\methodline[numeric object]{__rxor__}{self, other}
1170+
\methodline[numeric object]{__ror__}{self, other}
11711171
These functions are
11721172
called to implement the binary arithmetic operations (\code{+},
11731173
\code{-}, \code{*}, \code{/}, \code{\%},
@@ -1183,36 +1183,36 @@ \subsection{Emulating numeric types\label{numeric-types}}
11831183
complicated).
11841184
\end{methoddesc}
11851185

1186-
\begin{methoddesc}[numeric interface]{__neg__}{self}
1187-
\methodline{__pos__}{self}
1188-
\methodline{__abs__}{self}
1189-
\methodline{__invert__}{self}
1186+
\begin{methoddesc}[numeric object]{__neg__}{self}
1187+
\methodline[numeric object]{__pos__}{self}
1188+
\methodline[numeric object]{__abs__}{self}
1189+
\methodline[numeric object]{__invert__}{self}
11901190
Called to implement the unary arithmetic operations (\code{-}, \code{+},
11911191
\function{abs()}\bifuncindex{abs} and \code{~}).
11921192
\end{methoddesc}
11931193

1194-
\begin{methoddesc}[numeric interface]{__complex__}{self}
1195-
\methodline{__int__}{self}
1196-
\methodline{__long__}{self}
1197-
\methodline{__float__}{self}
1194+
\begin{methoddesc}[numeric object]{__complex__}{self}
1195+
\methodline[numeric object]{__int__}{self}
1196+
\methodline[numeric object]{__long__}{self}
1197+
\methodline[numeric object]{__float__}{self}
11981198
Called to implement the built-in functions
11991199
\function{complex()}\bifuncindex{complex},
12001200
\function{int()}\bifuncindex{int}, \function{long()}\bifuncindex{long},
12011201
and \function{float()}\bifuncindex{float}. Should return a value of
12021202
the appropriate type.
12031203
\end{methoddesc}
12041204

1205-
\begin{methoddesc}[numeric interface]{__oct__}{self}
1206-
\methodline{__hex__}{self}
1205+
\begin{methoddesc}[numeric object]{__oct__}{self}
1206+
\methodline[numeric object]{__hex__}{self}
12071207
Called to implement the built-in functions
12081208
\function{oct()}\bifuncindex{oct} and
12091209
\function{hex()}\bifuncindex{hex}. Should return a string value.
12101210
\end{methoddesc}
12111211

1212-
\begin{methoddesc}[numeric interface]{__coerce__}{self, other}
1212+
\begin{methoddesc}[numeric object]{__coerce__}{self, other}
12131213
Called to implement ``mixed-mode'' numeric arithmetic. Should either
12141214
return a 2-tuple containing \var{self} and \var{other} converted to
1215-
a common numeric type, or \code{None} if conversion is possible. When
1215+
a common numeric type, or \code{None} if conversion is impossible. When
12161216
the common type would be the type of \code{other}, it is sufficient to
12171217
return \code{None}, since the interpreter will also ask the other
12181218
object to attempt a coercion (but sometimes, if the implementation of

0 commit comments

Comments
 (0)