From ededa2e88fdb3064e60210cc8564932d373c3f62 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 11 Mar 2024 10:33:06 -0400 Subject: [PATCH] More spaceless union type annots --- tractor/_discovery.py | 4 ++-- tractor/_root.py | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tractor/_discovery.py b/tractor/_discovery.py index de79edc..99a4dd6 100644 --- a/tractor/_discovery.py +++ b/tractor/_discovery.py @@ -162,8 +162,8 @@ async def query_actor( @acm async def find_actor( name: str, - arbiter_sockaddr: tuple[str, int] | None = None, - registry_addrs: list[tuple[str, int]] | None = None, + arbiter_sockaddr: tuple[str, int]|None = None, + registry_addrs: list[tuple[str, int]]|None = None, only_first: bool = True, raise_on_none: bool = False, diff --git a/tractor/_root.py b/tractor/_root.py index f948913..6ee78b9 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -63,26 +63,26 @@ async def open_root_actor( *, # defaults are above - registry_addrs: list[tuple[str, int]] | None = None, + registry_addrs: list[tuple[str, int]]|None = None, # defaults are above - arbiter_addr: tuple[str, int] | None = None, + arbiter_addr: tuple[str, int]|None = None, - name: str | None = 'root', + name: str|None = 'root', # either the `multiprocessing` start method: # https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods # OR `trio` (the new default). - start_method: _spawn.SpawnMethodKey | None = None, + start_method: _spawn.SpawnMethodKey|None = None, # enables the multi-process debugger support debug_mode: bool = False, # internal logging - loglevel: str | None = None, + loglevel: str|None = None, - enable_modules: list | None = None, - rpc_module_paths: list | None = None, + enable_modules: list|None = None, + rpc_module_paths: list|None = None, # NOTE: allow caller to ensure that only one registry exists # and that this call creates it. @@ -108,7 +108,11 @@ async def open_root_actor( _state._runtime_vars['_is_root'] = True # caps based rpc list - enable_modules = enable_modules or [] + enable_modules = ( + enable_modules + or + [] + ) if rpc_module_paths: warnings.warn(