- Added support for cancellation reasons (the
reason
parameter toCancelScope.cancel()
) (#975) - Bumped the minimum version of Trio to v0.31.0
- Added the ability to enter the event loop from foreign (non-worker) threads by passing the return value of
anyio.lowlevel.current_token()
toanyio.from_thread.run()
andanyio.from_thread.run_sync()
as thetoken
keyword argument (#256) - Added pytest option (
anyio_mode = "auto"
) to make the pytest plugin automatically handle all async tests (#971) - Added the
anyio.Condition.wait_for()
method for feature parity with asyncio (#974) - Changed the default type argument of
anyio.abc.TaskStatus
fromAny
toNone
(#964) - Fixed TCP listener behavior to guarantee the same ephemeral port is used for all socket listeners when
local_port=0
(#857; PR by @11kkw and @agronholm) - Fixed inconsistency between Trio and asyncio where a TCP stream that previously raised a
BrokenResourceError
onsend()
would still raiseBrokenResourceError
after the stream was closed on asyncio, butClosedResourceError
on Trio. They now both raise aClosedResourceError
in this scenario. (#671)