from async_eval import eval
async def foo() -> int:
return 10
print(eval("await foo()"))
uriyyo / async-eval Goto Github PK
View Code? Open in Web Editor NEW🧬 python eval async code
License: MIT License
🧬 python eval async code
License: MIT License
Python 3.8.2 (default, Feb 26 2020, 02:56:10)
Traceback (most recent call last):
File "<eval>", line 28, in <module>
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/nest_asyncio.py", line 81, in run_until_complete
return f.result()
File "/usr/lib/python3.8/asyncio/futures.py", line 178, in result
raise self._exception
File "/usr/lib/python3.8/asyncio/tasks.py", line 280, in __step
result = coro.send(None)
File "<eval>", line 19, in __async_exec_func__
File "<eval>", line 9, in __async_exec_func__
NameError: name '__locals__' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 36, in <module>
REPL = debug.require("files/REPL @__main__")
File "/home/runner/LinkSafePremium/files/debug.py", line 403, in require
return getmodule(*args, **kwargs)
File "/home/runner/LinkSafePremium/files/debug.py", line 433, in getmodule
module = exec(f"from {regex[0]}.{regex[1]} import {regex[2]}\nreturn {regex[2]}")
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/async_eval/async_eval.py", line 200, in async_eval
exec(code_obj, _globals, _locals)
File "<eval>", line 40, in <module>
NameError: name '__locals__' is not defined
async-eval/async_eval/async_eval.py
Line 80 in d174bdf
try:
return False, await __func_wrapper__(_locals), copy_context()
except Exception as excpz:
return True, excpz, copy_context()
Good if not define veriable to no conflict
Hi. The package doesn't work with pypy 3.10.
It crashes on the save_locals() function with AttributeError: module 'ctypes' has no attribute 'pythonapi'.
When I comment that line, it seems to work ok, so it could not be hard to fix, but I don't understand function's purpose.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.