This website requires JavaScript.
Explore
Help
Sign In
djsundog
/
circuitpython
Watch
1
Star
0
Fork
0
You've already forked circuitpython
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
965caa0302
circuitpython
/
tests
/
import
/
gen_context.py
12 lines
109 B
Python
Raw
Normal View
History
Unescape
Escape
objgenerator: Generator must execute in its defining lexical context. I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
2014-04-16 22:49:47 -04:00
import
gen_context2
GLOBAL
=
"
GLOBAL
"
run code formatting script
2021-03-15 09:57:36 -04:00
objgenerator: Generator must execute in its defining lexical context. I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
2014-04-16 22:49:47 -04:00
def
gen
(
)
:
print
(
GLOBAL
)
yield
1
run code formatting script
2021-03-15 09:57:36 -04:00
objgenerator: Generator must execute in its defining lexical context. I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
2014-04-16 22:49:47 -04:00
gen_context2
.
call
(
gen
(
)
)
Reference in New Issue
Copy Permalink