Skip to content

Commit 6825d01

Browse files
mbyrnepr2sprytnyk
andcommitted
Add yield-outside-function documentation examples based on the pylint-errors project.
Co-authored-by: Vladyslav Krylasov <[email protected]>
1 parent 7e1726f commit 6825d01

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
for i in range(10):
2+
yield i # [yield-outside-function]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def get_values(data):
2+
yield from data
3+
4+
5+
for i in get_values(range(10)):
6+
pass

0 commit comments

Comments
 (0)