`Exception.__reduce__` causes copy.copy() to create a new argument
with the arguments from `Exception.__init__`, then overwrite
attributes from the original `__dict__`. This means that copying fails
if there are mandatory arguments that are not passed to `__init__`.
Fixes#1485
Callbacks added while the IOLoop is closing will now simply not be
called (which has always been a possible fate for callbacks added
just *before* the close). This exception has not proved to be very
useful and sometimes has false positives that are tricky to work around,
as seen in the linked issues.
Closes#1491.
Closes#1244.
`multi_future` is awkward to type but is much more prominent
in native coroutines. The new function `multi` has a more
convenient name and delegates to either the YieldPoint
or Future version automatically.
For backwards compatibility, `multi_future` is still around,
and `Multi` was renamed to `MultiYieldPoint` so that we don't
have two different objects whose names differ only in case
(`Multi` is now an alias for `multi`).
See #1493.
This makes the _wrap_awaitable infinite recursion less likely
to occur, although it could show up again when another coroutine
framework adopts PEP 492.
Fixes#1499.
On Python 3.5, this means supporting awaitables that are not
iterables. On older versions of python, this includes
* In `@gen.coroutine`, recognizing cython's coroutines
via the backports_abc module.
* At various points in the gen module, recognize cython's
use of `StopIteration.args[0]` in place of `StopIteration.value`.
* Implementing Future.__await__ and _wrap_awaitable for
pre-3.3 versions of python.
This simplifies the implementation since MutableMapping is designed
for subclassing while dict has many special cases that need to be
overridden. In particular, this change fixes the setdefault()
method.
Fixes#1500.
It is not necessary, since it will never need to invoke
wake, and as noted in add_callback_from_signal it would pose
no race risk, and it is a considerable performance penalty.