File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,17 @@ async def main():
50
50
asyncio.run(main())
51
51
```
52
52
53
- The optional globals passed to ` task([globals]) ` allows you to specify what
54
- will be in scope for the REPL. By default it uses ` __main__ ` , which is the
55
- same scope as the regular REPL (and ` main.py ` ). In the example above, the
56
- REPL will be able to call the ` demo() ` function as well as get/set the
57
- ` state ` variable.
53
+ An optional globals dictionary can be passed to ` aiorepl.task() ` , which allows
54
+ you to specify what will be in scope for the REPL. By default it uses the
55
+ globals dictionary from the ` __main__ ` module, which is the same scope as the
56
+ regular REPL (and ` main.py ` ). In the example above, the REPL will be able to
57
+ call the ` demo() ` function as well as get/set the ` state ` variable.
58
+
59
+ You can also provide your own dictionary, e.g. ` aiorepl.task({"obj": obj }) ` ,
60
+ or use the globals dict from the current module, e.g.
61
+ ` aiorepl.task(globals()) ` . Note that you cannot use a class instance's members
62
+ dictionary, e.g. ` aiorepl.task(obj.__dict__) ` , as this is read-only in
63
+ MicroPython.
58
64
59
65
Instead of the regular ` >>> ` prompt, the asyncio REPL will show ` --> ` .
60
66
You can’t perform that action at this time.
0 commit comments