Skip to content

Commit 317ee65

Browse files
Apply ruff/pyupgrade rule UP028
UP028 Replace `yield` over `for` loop with `yield from`
1 parent 26603de commit 317ee65

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/cffi/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ def enumfields(self, expand_anonymous_struct_union=True):
371371
if (name == '' and isinstance(type, StructOrUnion)
372372
and expand_anonymous_struct_union):
373373
# nested anonymous struct/union
374-
for result in type.enumfields():
375-
yield result
374+
yield from type.enumfields()
376375
else:
377376
yield (name, type, bitsize, quals)
378377

testing/cffi1/test_recompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,7 @@ def test_macro_var_callback():
12411241
#
12421242
values = ffi.new("int[50]")
12431243
def it():
1244-
for i in range(50):
1245-
yield i
1244+
yield from range(50)
12461245
it = it()
12471246
#
12481247
@ffi.callback("int *(*)(void)")

0 commit comments

Comments
 (0)