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
93719b56
Commit
93719b56
authored
Jun 17, 2003
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated documentation for the new slice arguments for list.index().
parent
e0a1bb63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Doc/lib/libstdtypes.tex
Doc/lib/libstdtypes.tex
+8
-3
No files found.
Doc/lib/libstdtypes.tex
View file @
93719b56
...
...
@@ -942,8 +942,9 @@ The following operations are defined on mutable sequence types (where
{
same as
\code
{
\var
{
s
}
[len(
\var
{
s
}
):len(
\var
{
s
}
)] =
\var
{
x
}}}{
(3)
}
\lineiii
{
\var
{
s
}
.count(
\var
{
x
}
)
}
{
return number of
\var
{
i
}
's for which
\code
{
\var
{
s
}
[
\var
{
i
}
] ==
\var
{
x
}}}{}
\lineiii
{
\var
{
s
}
.index(
\var
{
x
}
)
}
{
return smallest
\var
{
i
}
such that
\code
{
\var
{
s
}
[
\var
{
i
}
] ==
\var
{
x
}}}{
(4)
}
\lineiii
{
\var
{
s
}
.index(
\var
{
x
}
\optional
{
,
\var
{
i
}
\optional
{
,
\var
{
j
}}}
)
}
{
return smallest
\var
{
k
}
such that
\code
{
\var
{
s
}
[
\var
{
k
}
] ==
\var
{
x
}}
and
\code
{
\var
{
i
}
<=
\var
{
k
}
<
\var
{
j
}}}{
(4)
}
\lineiii
{
\var
{
s
}
.insert(
\var
{
i
}
,
\var
{
x
}
)
}
{
same as
\code
{
\var
{
s
}
[
\var
{
i
}
:
\var
{
i
}
] = [
\var
{
x
}
]
}}{
(5)
}
\lineiii
{
\var
{
s
}
.pop(
\optional
{
\var
{
i
}}
)
}
...
...
@@ -982,7 +983,11 @@ Notes:
mutable sequence types other than lists.
\item
[(4)]
Raises
\exception
{
ValueError
}
when
\var
{
x
}
is not found in
\var
{
s
}
.
\var
{
s
}
. When a negative index is passed as the second or third parameter
to the
\method
{
index()
}
method, the list length is added, as for slice
indices. If it is still negative, it is truncated to zero, as for
slice indices.
\versionchanged
[Previously,
\method
{
index()
}
didn't
have arguments for specifying start and stop positions]
{
2.3
}
\item
[(5)]
When a negative index is passed as the first parameter to
the
\method
{
insert()
}
method, the list length is added, as for slice
...
...
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