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
5d06c74f
Kaydet (Commit)
5d06c74f
authored
Mar 22, 2015
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge: #23700: fix/improve comment
üst
a4d4dd3a
75ed90a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
tempfile.py
Lib/tempfile.py
+4
-2
No files found.
Lib/tempfile.py
Dosyayı görüntüle @
5d06c74f
...
@@ -427,8 +427,10 @@ class _TemporaryFileWrapper:
...
@@ -427,8 +427,10 @@ class _TemporaryFileWrapper:
# iter() doesn't use __getattr__ to find the __iter__ method
# iter() doesn't use __getattr__ to find the __iter__ method
def
__iter__
(
self
):
def
__iter__
(
self
):
# Don't return iter(self.file), but yield from it to avoid closing
# Don't return iter(self.file), but yield from it to avoid closing
# file as long as it's being used as iterator, see issue #23000.
# file as long as it's being used as iterator (see issue #23700). We
# XXX Also don't use "yield from"!
# can't use 'yield from' here because iter(file) returns the file
# object itself, which has a close method, and thus the file would get
# closed when the generator is finalized, due to PEP380 semantics.
for
line
in
self
.
file
:
for
line
in
self
.
file
:
yield
line
yield
line
...
...
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