File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -158,5 +158,18 @@ def function_returning_int(r):
158
158
return 1
159
159
return 2
160
160
161
- assert len (function_returning_list (z )) # [len-as-condition]
161
+ def function_returning_generator (r ):
162
+ for i in [r , 1 , 2 , 3 ]:
163
+ yield i
164
+
165
+ def function_returning_comprehension (r ):
166
+ return [x + 1 for x in [r , 1 , 2 , 3 ]]
167
+
168
+ def function_returning_function (r ):
169
+ return function_returning_generator (r )
170
+
171
+ assert len (function_returning_list (z )) # [len-as-condition]
162
172
assert len (function_returning_int (z ))
173
+ assert len (function_returning_generator (z )) # [len-as-condition]
174
+ assert len (function_returning_comprehension (z )) # [len-as-condition]
175
+ assert len (function_returning_function (z )) # [len-as-condition]
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ len-as-condition:129:github_issue_1879:Do not use `len(SEQUENCE)` without compar
22
22
len-as-condition:130:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
23
23
len-as-condition:131:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
24
24
len-as-condition:161:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
25
+ len-as-condition:170:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
26
+ len-as-condition:171:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
You can’t perform that action at this time.
0 commit comments