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
d378b1f8
Kaydet (Commit)
d378b1f8
authored
Ara 24, 2018
tarafından
Chris Rands
Kaydeden (comit)
Raymond Hettinger
Ara 24, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34764: improve docs example of iter() with sentinel value (GH-11222)
üst
8874f511
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
functions.rst
Doc/library/functions.rst
+8
-7
2018-12-23-23-52-31.bpo-34764.DwOGeT.rst
...xt/Documentation/2018-12-23-23-52-31.bpo-34764.DwOGeT.rst
+2
-0
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
d378b1f8
...
...
@@ -810,13 +810,14 @@ are always available. They are listed here in alphabetical order.
See also :ref:`typeiter`.
One useful application of the second form of :func:`iter` is to read lines of
a file until a certain line is reached. The following example reads a file
until the :meth:`~io.TextIOBase.readline` method returns an empty string::
with open('mydata.txt') as fp:
for line in iter(fp.readline, ''):
process_line(line)
One useful application of the second form of :func:`iter` is to build a
block-reader. For example, reading fixed-width blocks from a binary
database file until the end of file is reached::
from functools import partial
with open('mydata.db', 'rb') as f:
for block in iter(partial(f.read, 64), ''):
process_block(block)
.. function:: len(s)
...
...
Misc/NEWS.d/next/Documentation/2018-12-23-23-52-31.bpo-34764.DwOGeT.rst
0 → 100644
Dosyayı görüntüle @
d378b1f8
Improve example of iter() with 2nd sentinel argument.
\ No newline at end of file
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