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
64801680
Kaydet (Commit)
64801680
authored
Eki 12, 2013
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19202: Add cross-reference and a rough code equivalent
üst
5d4121a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
functools.rst
Doc/library/functools.rst
+12
-0
itertools.rst
Doc/library/itertools.rst
+3
-0
No files found.
Doc/library/functools.rst
Dosyayı görüntüle @
64801680
...
@@ -185,6 +185,18 @@ The :mod:`functools` module defines the following functions:
...
@@ -185,6 +185,18 @@ The :mod:`functools` module defines the following functions:
a default when the sequence is empty. If *initializer* is not given and
a default when the sequence is empty. If *initializer* is not given and
*sequence* contains only one item, the first item is returned.
*sequence* contains only one item, the first item is returned.
Equivalent to::
def reduce(function, iterable, initializer=None):
it = iter(iterable)
if initializer is None:
value = next(it)
else:
value = initializer
for element in it:
value = function(value, element)
return value
.. function:: update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
.. function:: update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
...
...
Doc/library/itertools.rst
Dosyayı görüntüle @
64801680
...
@@ -135,6 +135,9 @@ loops that truncate the stream.
...
@@ -135,6 +135,9 @@ loops that truncate the stream.
'0.93', '0.25', '0.71', '0.79', '0.63', '0.88', '0.39', '0.91', '0.32',
'0.93', '0.25', '0.71', '0.79', '0.63', '0.88', '0.39', '0.91', '0.32',
'0.83', '0.54', '0.95', '0.20', '0.60', '0.91', '0.30', '0.80', '0.60']
'0.83', '0.54', '0.95', '0.20', '0.60', '0.91', '0.30', '0.80', '0.60']
See :func:`functools.reduce` for a similar function that returns only the
final accumulated value.
.. versionadded:: 3.2
.. versionadded:: 3.2
.. versionchanged:: 3.3
.. versionchanged:: 3.3
...
...
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