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

Skip to content

Commit a007382

Browse files
committed
Adjust the way __getslice__() is marked as deprecated; this will also
stand out more.
1 parent 304faf9 commit a007382

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/ref/ref3.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ \subsection{Emulating sequence and mapping types\label{sequence-types}}
10451045
sequence, or slice objects, which define a range of items. (For backwards
10461046
compatibility, the method \method{__getslice__()} (see below) can also be
10471047
defined to handle simple, but not extended slices.) It is also recommended
1048-
that mappings provide methods \method{keys()}, \method{values()},
1048+
that mappings provide the methods \method{keys()}, \method{values()},
10491049
\method{items()}, \method{has_key()}, \method{get()}, \method{clear()},
10501050
\method{copy()}, and \method{update()} behaving similar to those for
10511051
Python's standard dictionary objects; mutable sequences should provide
@@ -1132,6 +1132,8 @@ \subsection{Additional methods for emulation of sequence types
11321132
three methods.
11331133

11341134
\begin{methoddesc}[sequence object]{__getslice__}{self, i, j}
1135+
\deprecated{2.0}{Support slice objects as parameters to the
1136+
\method{__getitem__()} method.}
11351137
Called to implement evaluation of \code{\var{self}[\var{i}:\var{j}]}.
11361138
The returned object should be of the same type as \var{self}. Note
11371139
that missing \var{i} or \var{j} in the slice expression are replaced
@@ -1142,7 +1144,7 @@ \subsection{Additional methods for emulation of sequence types
11421144
No guarantee is made that indexes adjusted this way are not still
11431145
negative. Indexes which are greater than the length of the sequence
11441146
are not modified.
1145-
This method is deprecated. If no \method{__getslice__()} is found, a slice
1147+
If no \method{__getslice__()} is found, a slice
11461148
object is created instead, and passed to \method{__getitem__()} instead.
11471149
\end{methoddesc}
11481150

0 commit comments

Comments
 (0)