Skip to content

Commit 6b3eb6f

Browse files
committed
a few more yield from
1 parent bc543aa commit 6b3eb6f

File tree

7 files changed

+7
-14
lines changed

7 files changed

+7
-14
lines changed

src/sage/combinat/non_decreasing_parking_function.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ def __iter__(self):
419419
[[], [1], [1, 1], [1, 2], [1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 2]]
420420
"""
421421
for n in NN:
422-
for pf in NonDecreasingParkingFunctions_n(n):
423-
yield pf
422+
yield from NonDecreasingParkingFunctions_n(n)
424423

425424
def graded_component(self, n):
426425
"""

src/sage/combinat/species/functorial_composition_species.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def _structures(self, structure_class, s):
7171
{{1, 2}*{3}, {1, 3}*{2}, {2, 3}*{1}}]
7272
"""
7373
gs = self._G.structures(s).list()
74-
for f in self._F.structures(gs):
75-
yield f
74+
yield from self._F.structures(gs)
7675

7776
def _isotypes(self, structure_class, s):
7877
"""

src/sage/combinat/subset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,7 @@ def __iter__(self):
11301130
[1, 2, 2, 3]]
11311131
"""
11321132
for k in range(len(self._l) + 1):
1133-
for s in SubMultiset_sk(self._l, k):
1134-
yield s
1133+
yield from SubMultiset_sk(self._l, k)
11351134

11361135
def __call__(self, el):
11371136
r"""

src/sage/graphs/digraph_generators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,8 +1747,7 @@ def extra_property(x):
17471747
if vertices is None:
17481748
vertices = 0
17491749
while True:
1750-
for g in self(vertices, sparse=sparse, copy=copy):
1751-
yield g
1750+
yield from self(vertices, sparse=sparse, copy=copy)
17521751
vertices += 1
17531752

17541753
from sage.graphs.graph_generators import canaug_traverse_edge

src/sage/modular/multiple_zeta.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@ def extend_multiplicative_basis(B, n) -> Iterator:
575575
[((7,),), ((5,), (2,)), ((3,), (2,), (2,))]
576576
"""
577577
for pi in Partitions(n, min_part=2):
578-
for liste in cartesian_product([B[i] for i in pi]):
579-
yield liste
578+
yield from cartesian_product([B[i] for i in pi])
580579

581580

582581
# several classes for the algebra of MZV

src/sage/rings/polynomial/groebner_fan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,7 @@ def __iter__(self):
11571157
sage: next(a)
11581158
[y^9 - 3*y^6 + 3*y^3 - y - 1, -y^3 + x + 1]
11591159
"""
1160-
for x in self.reduced_groebner_bases():
1161-
yield x
1160+
yield from self.reduced_groebner_bases()
11621161

11631162
def __getitem__(self, i):
11641163
"""

src/sage/schemes/toric/points.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ def cone_iter(self):
350350
"""
351351
fan = self.fan
352352
for d in range(fan.dim(), -1, -1):
353-
for cone in fan.cones(d):
354-
yield cone
353+
yield from fan.cones(d)
355354

356355
def coordinate_iter(self):
357356
"""

0 commit comments

Comments
 (0)