@@ -58,7 +58,8 @@ def _tristate_set(context_var, enabled):
5858
5959
6060@contextmanager
61- def _tristate_armed (context_var : ContextVar , enabled ):
61+ def _tristate_armed (context_var : ContextVar , enabled = True ):
62+ """Assumes "enabled" if `enabled` flag is None."""
6263 resetter = context_var .set (enabled if enabled is None else bool (enabled ))
6364 try :
6465 yield
@@ -70,7 +71,7 @@ def _tristate_armed(context_var: ContextVar, enabled):
7071"""
7172Like :func:`set_debug()` as a context-manager, resetting back to old value.
7273
73- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
74+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
7475"""
7576is_debug = partial (_getter , _debug )
7677"""
@@ -139,7 +140,7 @@ def is_abort():
139140"""
140141Like :func:`set_skip_evictions()` as a context-manager, resetting back to old value.
141142
142- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
143+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
143144"""
144145is_skip_evictions = partial (_getter , _skip_evictions )
145146"""see :func:`set_skip_evictions()`"""
@@ -158,7 +159,7 @@ def is_abort():
158159"""
159160Like :func:`set_layered_solution()` as a context-manager, resetting back to old value.
160161
161- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
162+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
162163"""
163164is_layered_solution = partial (_getter , _layered_solution )
164165"""see :func:`set_layered_solution()`"""
@@ -184,7 +185,7 @@ def execution_pool_plugged(pool: "Optional[Pool]"):
184185 """
185186 Like :func:`set_execution_pool()` as a context-manager, resetting back to old value.
186187
187- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
188+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
188189 """
189190 resetter = _execution_pool .set (pool )
190191 try :
@@ -212,7 +213,7 @@ def get_execution_pool() -> "Optional[Pool]":
212213"""
213214(deprecated) Like :func:`set_parallel_tasks()` as a context-manager, resetting back to old value.
214215
215- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
216+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
216217"""
217218is_parallel_tasks = partial (_getter , _parallel_tasks )
218219"""see :func:`set_parallel_tasks()`"""
@@ -233,7 +234,7 @@ def get_execution_pool() -> "Optional[Pool]":
233234"""
234235(deprecated) Like :func:`set_marshal_tasks()` as a context-manager, resetting back to old value.
235236
236- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
237+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
237238"""
238239is_marshal_tasks = partial (_getter , _marshal_tasks )
239240"""(deprecated) see :func:`set_marshal_tasks()`"""
@@ -256,7 +257,7 @@ def get_execution_pool() -> "Optional[Pool]":
256257"""
257258Like :func:`set_endure_operations()` as a context-manager, resetting back to old value.
258259
259- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
260+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
260261"""
261262is_endure_operations = partial (_getter , _endure_operations )
262263"""see :func:`set_endure_operations()`"""
@@ -278,7 +279,7 @@ def get_execution_pool() -> "Optional[Pool]":
278279"""
279280Like :func:`set_reschedule_operations()` as a context-manager, resetting back to old value.
280281
281- .. seealso:: disclaimer about context-managers the top of this :mod:`.config` module.
282+ .. seealso:: disclaimer about context-managers at the top of this :mod:`.config` module.
282283"""
283284is_reschedule_operations = partial (_getter , _reschedule_operations )
284285"""see :func:`set_reschedule_operations()`"""
0 commit comments