Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ef428a29
Kaydet (Commit)
ef428a29
authored
Eki 26, 2001
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Explain what [].insert() does when the target index is negative.
üst
d5be3b75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
libstdtypes.tex
Doc/lib/libstdtypes.tex
+11
-7
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
ef428a29
...
...
@@ -839,15 +839,15 @@ The following operations are defined on mutable sequence types (where
{
return smallest
\var
{
i
}
such that
\code
{
\var
{
s
}
[
\var
{
i
}
] ==
\var
{
x
}}}{
(3)
}
\lineiii
{
\var
{
s
}
.insert(
\var
{
i
}
,
\var
{
x
}
)
}
{
same as
\code
{
\var
{
s
}
[
\var
{
i
}
:
\var
{
i
}
] = [
\var
{
x
}
]
}
if
\code
{
\var
{
i
}
>= 0
}}{}
if
\code
{
\var
{
i
}
>= 0
}}{
(4)
}
\lineiii
{
\var
{
s
}
.pop(
\optional
{
\var
{
i
}}
)
}
{
same as
\code
{
\var
{
x
}
=
\var
{
s
}
[
\var
{
i
}
]; del
\var
{
s
}
[
\var
{
i
}
]; return
\var
{
x
}}}{
(
4
)
}
{
same as
\code
{
\var
{
x
}
=
\var
{
s
}
[
\var
{
i
}
]; del
\var
{
s
}
[
\var
{
i
}
]; return
\var
{
x
}}}{
(
5
)
}
\lineiii
{
\var
{
s
}
.remove(
\var
{
x
}
)
}
{
same as
\code
{
del
\var
{
s
}
[
\var
{
s
}
.index(
\var
{
x
}
)]
}}{
(3)
}
\lineiii
{
\var
{
s
}
.reverse()
}
{
reverses the items of
\var
{
s
}
in place
}{
(
5
)
}
{
reverses the items of
\var
{
s
}
in place
}{
(
6
)
}
\lineiii
{
\var
{
s
}
.sort(
\optional
{
\var
{
cmpfunc
}}
)
}
{
sort the items of
\var
{
s
}
in place
}{
(
5), (6
)
}
{
sort the items of
\var
{
s
}
in place
}{
(
6), (7
)
}
\end{tableiii}
\indexiv
{
operations on
}{
mutable
}{
sequence
}{
types
}
\indexiii
{
operations on
}{
sequence
}{
types
}
...
...
@@ -874,16 +874,20 @@ Notes:
\item
[(3)]
Raises
\exception
{
ValueError
}
when
\var
{
x
}
is not found in
\var
{
s
}
.
\item
[(4)]
The
\method
{
pop()
}
method is only supported by the list and
\item
[(4)]
When a negative index is passed as the first parameter to
the
\method
{
insert()
}
method, the new element is prepended to the
sequence.
\item
[(5)]
The
\method
{
pop()
}
method is only supported by the list and
array types. The optional argument
\var
{
i
}
defaults to
\code
{
-1
}
,
so that by default the last item is removed and returned.
\item
[(
5
)]
The
\method
{
sort()
}
and
\method
{
reverse()
}
methods modify the
\item
[(
6
)]
The
\method
{
sort()
}
and
\method
{
reverse()
}
methods modify the
list in place for economy of space when sorting or reversing a large
list. To remind you that they operate by side effect, they don't return
the sorted or reversed list.
\item
[(
6
)]
The
\method
{
sort()
}
method takes an optional argument
\item
[(
7
)]
The
\method
{
sort()
}
method takes an optional argument
specifying a comparison function of two arguments (list items) which
should return a negative, zero or positive number depending on whether
the first argument is considered smaller than, equal to, or larger
...
...
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