- Added support for cancellation reasons (the
reasonparameter 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 thetokenkeyword 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.TaskStatusfromAnytoNone(#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
BrokenResourceErroronsend()would still raiseBrokenResourceErrorafter the stream was closed on asyncio, butClosedResourceErroron Trio. They now both raise aClosedResourceErrorin this scenario. (#671)