forked from goodboy/tractor
1
0
Fork 0

Add note about using `@acm` as decorator in 3.10

runtime_to_msgspec
Tyler Goodlet 2024-06-17 10:32:38 -04:00
parent affc210033
commit 872feef24b
1 changed files with 5 additions and 1 deletions

View File

@ -2399,7 +2399,11 @@ def mk_context(
# |_ `return: TypeAlias`, # |_ `return: TypeAlias`,
# |_ `invalid_policy: str|Callable` ? # |_ `invalid_policy: str|Callable` ?
# -[ ] prolly implement the `@acm` wrapper using # -[ ] prolly implement the `@acm` wrapper using
# a `contextlib.ContextDecorator`? # a `contextlib.ContextDecorator`, i guess not if
# we don't need an `__aexit__` block right?
# |_ de hecho, @acm can already be used as a decorator as of 3.10
# but i dunno how that's gonna play with `trio.Nursery.start[_soon]()`
# |_ https://docs.python.org/3/library/contextlib.html#using-a-context-manager-as-a-function-decorator
# #
def context( def context(
func: Callable|None = None, func: Callable|None = None,