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
0eec0879
Kaydet (Commit)
0eec0879
authored
Agu 08, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Explain argument unpacking
üst
a6a277d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tut.tex
Doc/tut/tut.tex
+18
-0
No files found.
Doc/tut/tut.tex
Dosyayı görüntüle @
0eec0879
...
@@ -1577,6 +1577,24 @@ def fprintf(file, format, *args):
...
@@ -1577,6 +1577,24 @@ def fprintf(file, format, *args):
\end
{
verbatim
}
\end
{
verbatim
}
\subsection
{
Unpacking Argument Lists
\label
{
unpacking
-
arguments
}}
The reverse situation occurs when the arguments are already in a list
or tuple but need to be unpacked for a function call requiring separate
positional arguments. For instance, the built
-
in
\function
{
range
()
}
function expects separate
\var
{
start
}
and
\var
{
stop
}
arguments. If they
are not available separately, write the function call with the
\code
{
*
}
-
operator to unpack the arguments out of a list or tuple:
\begin
{
verbatim
}
>>> range
(
3
,
6
)
# normal call with separate arguments
[
3
,
4
,
5
]
>>> args
=
[
3
,
6
]
>>> range
(*
args
)
# call with arguments unpacked from a list
[
3
,
4
,
5
]
\end
{
verbatim
}
\subsection
{
Lambda Forms
\label
{
lambda
}}
\subsection
{
Lambda Forms
\label
{
lambda
}}
By popular demand, a few features commonly found in functional
By popular demand, a few features commonly found in functional
...
...
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