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
b37df519
Kaydet (Commit)
b37df519
authored
Agu 07, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix yield from return value on custom iterators (closes #15568)
üst
a0abb440
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
test_pep380.py
Lib/test/test_pep380.py
+14
-0
NEWS
Misc/NEWS
+3
-0
ceval.c
Python/ceval.c
+1
-1
No files found.
Lib/test/test_pep380.py
Dosyayı görüntüle @
b37df519
...
...
@@ -940,6 +940,20 @@ class TestPEP380Operation(unittest.TestCase):
for
stack
in
spam
(
eggs
(
gen
())):
self
.
assertTrue
(
'spam'
in
stack
and
'eggs'
in
stack
)
def
test_custom_iterator_return
(
self
):
# See issue #15568
class
MyIter
:
def
__iter__
(
self
):
return
self
def
__next__
(
self
):
raise
StopIteration
(
42
)
def
gen
():
nonlocal
ret
ret
=
yield
from
MyIter
()
ret
=
None
list
(
gen
())
self
.
assertEqual
(
ret
,
42
)
def
test_main
():
from
test
import
support
...
...
Misc/NEWS
Dosyayı görüntüle @
b37df519
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Beta 2?
Core and Builtins
-----------------
- Issue #15568: Fix the return value of "yield from" when StopIteration is
raised by a custom iterator.
- Issue #13119: sys.stdout and sys.stderr are now using "\r\n" newline on
Windows, as Python 2.
...
...
Python/ceval.c
Dosyayı görüntüle @
b37df519
...
...
@@ -1843,7 +1843,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
}
else
{
_Py_IDENTIFIER
(
send
);
if
(
u
==
Py_None
)
retval
=
Py
Iter_N
ext
(
x
);
retval
=
Py
_TYPE
(
x
)
->
tp_itern
ext
(
x
);
else
retval
=
_PyObject_CallMethodId
(
x
,
&
PyId_send
,
"O"
,
u
);
}
...
...
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