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
68921dfa
Kaydet (Commit)
68921dfa
authored
Agu 09, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
In note mentioning [].remove()'s exception, tell what exception is
raised. Prompted by Barry's whining. ;-0
üst
09be4092
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
25 deletions
+21
-25
libstdtypes.tex
Doc/lib/libstdtypes.tex
+21
-25
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
68921dfa
...
...
@@ -478,43 +478,39 @@ The following operations are defined on mutable sequence types (where
\indexii
{
slice
}{
assignment
}
\stindex
{
del
}
\withsubitem
{
(list method)
}{
\ttindex
{
append()
}
\ttindex
{
extend()
}
\ttindex
{
count()
}
\ttindex
{
index()
}
\ttindex
{
insert()
}
\ttindex
{
pop()
}
\ttindex
{
remove()
}
\ttindex
{
reverse()
}
\ttindex
{
append()
}
\ttindex
{
extend()
}
\ttindex
{
count()
}
\ttindex
{
index()
}
\ttindex
{
insert()
}
\ttindex
{
pop()
}
\ttindex
{
remove()
}
\ttindex
{
reverse()
}
\ttindex
{
sort()
}}
\noindent
Notes:
\begin{description}
\item
[(1)]
Raises an exception when
\var
{
x
}
is not found in
\var
{
s
}
.
\item
[(1)]
Raises
\exception
{
ValueError
}
when
\var
{
x
}
is not found in
\var
{
s
}
.
\item
[(2)]
The
\method
{
sort()
}
method takes an optional argument
specifying a comparison function of two arguments (list items) which
should return
\code
{
-1
}
,
\code
{
0
}
or
\code
{
1
}
depending on whether the
first argument is considered smaller than, equal to, or larger than the
second argument. Note that this slows the sorting process down
considerably; e.g. to sort a list in reverse order it is much faster
to use calls to the methods
\method
{
sort()
}
and
\method
{
reverse()
}
than to use the built-in function
\function
{
sort()
}
with a
comparison function that reverses the ordering of the elements.
should return
\code
{
-1
}
,
\code
{
0
}
or
\code
{
1
}
depending on whether
the first argument is considered smaller than, equal to, or larger
than the second argument. Note that this slows the sorting process
down considerably; e.g. to sort a list in reverse order it is much
faster to use calls to the methods
\method
{
sort()
}
and
\method
{
reverse()
}
than to use the built-in function
\function
{
sort()
}
with a comparison function that reverses the
ordering of the elements.
\item
[(3)]
The
\method
{
sort()
}
and
\method
{
reverse()
}
methods modify the
list in place for economy of space when sorting or reversing a large
list. They don't return the sorted or reversed list to remind you of
this side effect.
list in place for economy of space when sorting or reversing a large
list. They don't return the sorted or reversed list to remind you
of
this side effect.
\item
[(4)]
The
\method
{
pop()
}
method is experimental and not supported
by other mutable sequence types than lists.
The optional argument
\var
{
i
}
defaults to
\code
{
-1
}
, so that
by default the last item is
removed and returned.
by other mutable sequence types than lists. The optional argument
\var
{
i
}
defaults to
\code
{
-1
}
, so that by default the last item is
removed and returned.
\item
[(5)]
Raises an exception when
\var
{
x
}
is not a list object. The
\method
{
extend()
}
method is experimental and not supported by mutable types
other than lists.
\method
{
extend()
}
method is experimental and not supported by
mutable types
other than lists.
\end{description}
...
...
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