Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a0073825
Commit
a0073825
authored
Aug 18, 2000
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust the way __getslice__() is marked as deprecated; this will also
stand out more.
parent
304faf94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+4
-2
No files found.
Doc/ref/ref3.tex
View file @
a0073825
...
@@ -1045,7 +1045,7 @@ sequence, the allowable keys should be the integers \var{k} for which
...
@@ -1045,7 +1045,7 @@ sequence, the allowable keys should be the integers \var{k} for which
sequence, or slice objects, which define a range of items. (For backwards
sequence, or slice objects, which define a range of items. (For backwards
compatibility, the method
\method
{__
getslice
__
()
}
(see below) can also be
compatibility, the method
\method
{__
getslice
__
()
}
(see below) can also be
defined to handle simple, but not extended slices.) It is also recommended
defined to handle simple, but not extended slices.) It is also recommended
that mappings provide methods
\method
{
keys()
}
,
\method
{
values()
}
,
that mappings provide
the
methods
\method
{
keys()
}
,
\method
{
values()
}
,
\method
{
items()
}
,
\method
{
has
_
key()
}
,
\method
{
get()
}
,
\method
{
clear()
}
,
\method
{
items()
}
,
\method
{
has
_
key()
}
,
\method
{
get()
}
,
\method
{
clear()
}
,
\method
{
copy()
}
, and
\method
{
update()
}
behaving similar to those for
\method
{
copy()
}
, and
\method
{
update()
}
behaving similar to those for
Python's standard dictionary objects; mutable sequences should provide
Python's standard dictionary objects; mutable sequences should provide
...
@@ -1132,6 +1132,8 @@ objects. Immutable sequences methods should only define
...
@@ -1132,6 +1132,8 @@ objects. Immutable sequences methods should only define
three methods.
three methods.
\begin{methoddesc}
[sequence object]
{__
getslice
__}{
self, i, j
}
\begin{methoddesc}
[sequence object]
{__
getslice
__}{
self, i, j
}
\deprecated
{
2.0
}{
Support slice objects as parameters to the
\method
{__
getitem
__
()
}
method.
}
Called to implement evaluation of
\code
{
\var
{
self
}
[
\var
{
i
}
:
\var
{
j
}
]
}
.
Called to implement evaluation of
\code
{
\var
{
self
}
[
\var
{
i
}
:
\var
{
j
}
]
}
.
The returned object should be of the same type as
\var
{
self
}
. Note
The returned object should be of the same type as
\var
{
self
}
. Note
that missing
\var
{
i
}
or
\var
{
j
}
in the slice expression are replaced
that missing
\var
{
i
}
or
\var
{
j
}
in the slice expression are replaced
...
@@ -1142,7 +1144,7 @@ If the instance does not implement the \method{__len__()} method, an
...
@@ -1142,7 +1144,7 @@ If the instance does not implement the \method{__len__()} method, an
No guarantee is made that indexes adjusted this way are not still
No guarantee is made that indexes adjusted this way are not still
negative. Indexes which are greater than the length of the sequence
negative. Indexes which are greater than the length of the sequence
are not modified.
are not modified.
This method is deprecated.
If no
\method
{__
getslice
__
()
}
is found, a slice
If no
\method
{__
getslice
__
()
}
is found, a slice
object is created instead, and passed to
\method
{__
getitem
__
()
}
instead.
object is created instead, and passed to
\method
{__
getitem
__
()
}
instead.
\end{methoddesc}
\end{methoddesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment