python-ast-explorer
python-ast-explorer copied to clipboard
Add support for python3
Type annotations for example just give an error
@Daenyth @maligree @ivan111
cpython-3.7.4/Lib/test/test_asyncio/utils.py
this code can compile in python3.74
def _run_test_server(*, address, use_ssl=False, server_cls, server_ssl_cls):
def app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain')]
start_response(status, headers)
return [b'Test message']
server_class = server_ssl_cls if use_ssl else server_cls
httpd = server_class(address, SilentWSGIRequestHandler)
httpd.set_app(app)
httpd.address = httpd.server_address
server_thread = threading.Thread(target=lambda : httpd.serve_forever(
poll_interval=0.05))
server_thread.start()
try:
yield httpd
finally:
httpd.shutdown()
httpd.server_close()
server_thread.join()
I find it very useful when understanding some weird code, usually with newly introduced syntax.
The only problem is that the Python version it supported is too outdated.
It would be great if the website backend is upgraded.