Overview

Tornado 6.3, released on January 30, 2023, adds official Python 3.11 support and improves HTTP server performance.

Main Features

Python 3.11 support

Tornado 6.3 is fully compatible with Python 3.11, leveraging asyncio performance improvements and exception groups.

python
import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    async def get(self):
        self.write({'message': 'Tornado 6.3 with Python 3.11'})

app = tornado.web.Application([
    (r'/', MainHandler),
])

# app.listen(8888)
# tornado.ioloop.IOLoop.current().start()

Improved HTTP performance

The built-in HTTP server benefits from request parsing optimizations and improved keep-alive connection handling, reducing latency under high load.

python
import tornado.web
import tornado.httpclient

class ApiHandler(tornado.web.RequestHandler):
    async def get(self):
        # Improved async HTTP client
        client = tornado.httpclient.AsyncHTTPClient()
        response = await client.fetch('https://api.example.com/data')
        self.write(response.body)

Sources