Need py__bool__ on generators as well as any other object.
This commit is contained in:
1 parent
23fe08363d
commit
2b1ddb19c9
2 files changed
+13
-3
No files matched your search
@@ -24,6 +24,13 @@ next(gen_ret(1))
|
||||
#? []
|
||||
next(gen_ret())
|
||||
|
||||
# generators evaluate to true if cast by bool.
|
||||
a = ''
|
||||
if gen_ret():
|
||||
a = 3
|
||||
#? int()
|
||||
a
|
||||
|
||||
|
||||
# -----------------
|
||||
# generators should not be indexable
|
||||
|
||||
Reference in new issue
Block a user