You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Inspecting the :attr:`~trio.CancelScope.cancel_called` attribute of a
61
+
not-yet-exited cancel scope whose deadline is in the past now always
62
+
returns ``True``, like you might expect. (Previously it would return
63
+
``False`` for not-yet-entered cancel scopes, and for active cancel
64
+
scopes until the first checkpoint after their deadline expiry.) (`#958 <https://github.com/python-trio/trio/issues/958>`__)
65
+
- The :class:`trio.Path` classmethods, :meth:`~trio.Path.home` and
66
+
:meth:`~trio.Path.cwd`, are now async functions. Previously, a bug
67
+
in the forwarding logic meant :meth:`~trio.Path.cwd` was synchronous
68
+
and :meth:`~trio.Path.home` didn't work at all. (`#960 <https://github.com/python-trio/trio/issues/960>`__)
69
+
- An exception encapsulated within a :class:`MultiError` doesn't need to be
70
+
hashable anymore.
71
+
72
+
.. note::
73
+
74
+
This is only supported if you are running python >= 3.6.4. You can
75
+
refer to `this github PR <https://github.com/python/cpython/pull/4014>`_
76
+
for details. (`#1005 <https://github.com/python-trio/trio/issues/1005>`__)
77
+
78
+
79
+
Improved Documentation
80
+
~~~~~~~~~~~~~~~~~~~~~~
81
+
82
+
- To help any user reading through Trio's function implementations, start using public names (not _core) whenever possible. (`#1017 <https://github.com/python-trio/trio/issues/1017>`__)
83
+
84
+
85
+
Deprecations and Removals
86
+
~~~~~~~~~~~~~~~~~~~~~~~~~
87
+
88
+
- The ``clear`` method on `trio.Event` has been deprecated. (`#637 <https://github.com/python-trio/trio/issues/637>`__)
89
+
- ``run_sync_in_worker_thread`` has become `trio.to_thread.run_sync`, in
90
+
order to make it shorter, and more consistent with the new
91
+
``trio.from_thread``. And ``current_default_worker_thread_limiter`` is
92
+
now `trio.to_thread.current_default_thread_limiter`. (Of course the
93
+
old names still work with a deprecation warning, for now.) (`#810 <https://github.com/python-trio/trio/issues/810>`__)
94
+
- Give up on trying to have different low-level waiting APIs on Unix and
95
+
Windows. All platforms now have `trio.hazmat.wait_readable`,
96
+
`trio.hazmat.wait_writable`, and `trio.hazmat.notify_closing`. The old
97
+
platform-specific synonyms ``wait_socket_*``,
98
+
``notify_socket_closing``, and ``notify_fd_closing`` have been
- It turns out that it's better to treat subprocess spawning as an async
101
+
operation. Therefore, direct construction of `Process` objects has
102
+
been deprecated. Use `trio.open_process` instead. (`#1109 <https://github.com/python-trio/trio/issues/1109>`__)
103
+
104
+
105
+
Miscellaneous internal changes
106
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107
+
108
+
- The plumbing of Trio's cancellation system has been substantially overhauled
109
+
to improve performance and ease future planned improvements. Notably, there is
110
+
no longer any internal concept of a "cancel stack", and checkpoints now take
111
+
constant time regardless of the cancel scope nesting depth. (`#58 <https://github.com/python-trio/trio/issues/58>`__)
112
+
- We've slightly relaxed our definition of which Trio operations act as
113
+
:ref:`checkpoints <checkpoint-rule>`. A Trio async function that exits by
114
+
throwing an exception is no longer guaranteed to execute a checkpoint;
115
+
it might or might not. The rules are unchanged for async functions that
116
+
don't exit with an exception, async iterators, and async context managers.
117
+
:func:`trio.testing.assert_checkpoints` has been updated to reflect the
118
+
new behavior: if its ``with`` block exits with an exception, no assertion
119
+
is made. (`#474 <https://github.com/python-trio/trio/issues/474>`__)
120
+
- Calling ``str`` on a :exc:`trio.Cancelled` exception object returns "Cancelled" instead of an empty string. (`#674 <https://github.com/python-trio/trio/issues/674>`__)
121
+
- Change the default timeout in :func:`trio.open_tcp_stream` to 0.250 seconds, for consistency with RFC 8305. (`#762 <https://github.com/python-trio/trio/issues/762>`__)
122
+
- On win32 we no longer set SO_EXCLUSIVEADDRUSE when binding a socket in :exc:`trio.open_tcp_listeners`. (`#928 <https://github.com/python-trio/trio/issues/928>`__)
123
+
- Any attempt to inherit from `CancelScope` or `Nursery` now raises
124
+
`TypeError`. (Trio has never been able to safely support subclassing
125
+
here; this change just makes it more obvious.)
126
+
Also exposed as public classes for type-checking, etc. (`#1021 <https://github.com/python-trio/trio/issues/1021>`__)
0 commit comments