Fix minor usage and consistency nits.
This commit is contained in:
parent
624c8af706
commit
18d8d5a708
|
@ -1145,9 +1145,10 @@ multiplication (meaning repetition) by defining the methods
|
||||||
\method{__mul__()}, \method{__rmul__()} and \method{__imul__()} described
|
\method{__mul__()}, \method{__rmul__()} and \method{__imul__()} described
|
||||||
below; they should not define \method{__coerce__()} or other numerical
|
below; they should not define \method{__coerce__()} or other numerical
|
||||||
operators. It is recommended that both mappings and sequences
|
operators. It is recommended that both mappings and sequences
|
||||||
implement the \method{__contains__}, to allow efficient use of the
|
implement the \method{__contains__()} method to allow efficient use of
|
||||||
\code{in} operator; for mappings, \code{in} should be equivalent of
|
the \code{in} operator; for mappings, \code{in} should be equivalent
|
||||||
\method{has_key()}; for sequences, it should search through the values.
|
of \method{has_key()}; for sequences, it should search through the
|
||||||
|
values.
|
||||||
\withsubitem{(mapping object method)}{
|
\withsubitem{(mapping object method)}{
|
||||||
\ttindex{keys()}
|
\ttindex{keys()}
|
||||||
\ttindex{values()}
|
\ttindex{values()}
|
||||||
|
@ -1310,7 +1311,7 @@ the \method{__*item__()} methods.
|
||||||
Calling \code{max(0, i)} conveniently returns the proper value.
|
Calling \code{max(0, i)} conveniently returns the proper value.
|
||||||
|
|
||||||
The membership test operators (\keyword{in} and \keyword{not in}) are
|
The membership test operators (\keyword{in} and \keyword{not in}) are
|
||||||
normally implemented as iteration loop through the sequence. However,
|
normally implemented as an iteration through the sequence. However,
|
||||||
sequence objects can supply the following special method with a more
|
sequence objects can supply the following special method with a more
|
||||||
efficient implementation:
|
efficient implementation:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue