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
df9a5f5e
Kaydet (Commit)
df9a5f5e
authored
Agu 01, 2011
tarafından
Jason R. Coombs
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12666: Clarifying changes in map for Python 3
üst
9aa20aff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
3.0.rst
Doc/whatsnew/3.0.rst
+9
-1
No files found.
Doc/whatsnew/3.0.rst
Dosyayı görüntüle @
df9a5f5e
...
...
@@ -154,7 +154,9 @@ Some well-known APIs no longer return lists:
:meth:`dict.itervalues` methods are no longer supported.
* :func:`map` and :func:`filter` return iterators. If you really need
a list, a quick fix is e.g. ``list(map(...))``, but a better fix is
a list and the input sequences are all of equal length, a quick
fix is to wrap :func:`map` in :func:`list`, e.g. ``list(map(...))``,
but a better fix is
often to use a list comprehension (especially when the original code
uses :keyword:`lambda`), or rewriting the code so it doesn't need a
list at all. Particularly tricky is :func:`map` invoked for the
...
...
@@ -162,6 +164,12 @@ Some well-known APIs no longer return lists:
regular :keyword:`for` loop (since creating a list would just be
wasteful).
If the input sequences are not of equal length, :func:`map` will
stop at the termination of the shortest of the sequences. For full
compatibility with `map` from Python 2.x, also wrap the sequences in
:func:`itertools.zip_longest`, e.g. ``map(func, *sequences)`` becomes
``list(map(func, itertools.zip_longest(*sequences)))``.
* :func:`range` now behaves like :func:`xrange` used to behave, except
it works with values of arbitrary size. The latter no longer
exists.
...
...
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