Commit 48bf3a7
committed
inspect: Fix isgenerator logic.
Also optimise both `isgenerator()` and `isgeneratorfunction()` so they use
the same lambda, and don't have to create it each time they are called.
Fixes issue micropython#997.
Signed-off-by: Damien George <damien@micropython.org>1 parent 9307e21 commit 48bf3a7
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
0 commit comments