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
7d14015e
Kaydet (Commit)
7d14015e
authored
Eki 06, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16120: Use |yield from| in stdlib.
Patch by Berker Peksag.
üst
c018f571
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
btm_utils.py
Lib/lib2to3/btm_utils.py
+2
-4
pytree.py
Lib/lib2to3/pytree.py
+3
-6
loader.py
Lib/unittest/loader.py
+1
-2
No files found.
Lib/lib2to3/btm_utils.py
Dosyayı görüntüle @
7d14015e
...
...
@@ -96,8 +96,7 @@ class MinNode(object):
def
leaves
(
self
):
"Generator that returns the leaves of the tree"
for
child
in
self
.
children
:
for
x
in
child
.
leaves
():
yield
x
yield
from
child
.
leaves
()
if
not
self
.
children
:
yield
self
...
...
@@ -277,7 +276,6 @@ def rec_test(sequence, test_func):
sub-iterables"""
for
x
in
sequence
:
if
isinstance
(
x
,
(
list
,
tuple
)):
for
y
in
rec_test
(
x
,
test_func
):
yield
y
yield
from
rec_test
(
x
,
test_func
)
else
:
yield
test_func
(
x
)
Lib/lib2to3/pytree.py
Dosyayı görüntüle @
7d14015e
...
...
@@ -194,8 +194,7 @@ class Base(object):
def
leaves
(
self
):
for
child
in
self
.
children
:
for
x
in
child
.
leaves
():
yield
x
yield
from
child
.
leaves
()
def
depth
(
self
):
if
self
.
parent
is
None
:
...
...
@@ -274,16 +273,14 @@ class Node(Base):
def
post_order
(
self
):
"""Return a post-order iterator for the tree."""
for
child
in
self
.
children
:
for
node
in
child
.
post_order
():
yield
node
yield
from
child
.
post_order
()
yield
self
def
pre_order
(
self
):
"""Return a pre-order iterator for the tree."""
yield
self
for
child
in
self
.
children
:
for
node
in
child
.
pre_order
():
yield
node
yield
from
child
.
pre_order
()
def
_prefix_getter
(
self
):
"""
...
...
Lib/unittest/loader.py
Dosyayı görüntüle @
7d14015e
...
...
@@ -291,8 +291,7 @@ class TestLoader(object):
# tests loaded from package file
yield
tests
# recurse into the package
for
test
in
self
.
_find_tests
(
full_path
,
pattern
):
yield
test
yield
from
self
.
_find_tests
(
full_path
,
pattern
)
else
:
try
:
yield
load_tests
(
self
,
tests
,
pattern
)
...
...
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