The new async/await keywords in Python 3.5 are supported. In most cases,
async def can be used in place of the @gen.coroutine decorator.
Inside a function defined with async def, use await instead of
yield to wait on an asynchronous operation. Coroutines defined with
async/await will be faster than those defined with @gen.coroutine and
yield, but do not support some features including Callback/Wait or
the ability to yield a Twisted Deferred. See the users’
guide for more.
The async/await keywords are also available when compiling with Cython in
older versions of Python.
Deprecation notice
This will be the last release of Tornado to support Python 2.6 or 3.2.
Note that PyPy3 will continue to be supported even though it implements
a mix of Python 3.2 and 3.3 features.
Installation
Tornado has several new dependencies: ordereddict on Python 2.6,
singledispatch on all Python versions prior to 3.4 (This was an
optional dependency in prior versions of Tornado, and is now
mandatory), and backports_abc>=0.4 on all versions prior to
3.5. These dependencies will be installed automatically when installing
with pip or setup.py install. These dependencies will not
be required when running on Google App Engine.
Binary wheels are provided for Python 3.5 on Windows (32 and 64 bit).
WaitIterator now supports the async for statement on Python 3.5.
@gen.coroutine can be applied to functions compiled with Cython.
On python versions prior to 3.5, the backports_abc package must
be installed for this functionality.
Multi and multi_future are deprecated and replaced by
a unified function multi.
Coroutine-style usage of IOStream now converts most errors into
StreamClosedError, which has the effect of reducing log noise from
exceptions that are outside the application’s control (especially
SSL errors).
StreamClosedError now has a real_error attribute which indicates
why the stream was closed. It is the same as the error attribute of
IOStream but may be more easily accessible than the IOStream itself.
tornado.locale.load_translations now accepts encodings other than
UTF-8. UTF-16 and UTF-8 will be detected automatically if a BOM is
present; for other encodings load_translations has an encoding
parameter.
Whitespace handling has become more configurable. The Loader
constructor now has a whitespace argument, there is a new
template_whitespaceApplication setting, and there is a new
{% whitespace %} template directive. All of these options take
a mode name defined in the tornado.template.filter_whitespace function.
The default mode is single, which is the same behavior as prior
versions of Tornado.