Skip to content

Commit

Permalink
chore: shorten modifier kwarg names
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Feb 28, 2023
1 parent 99dc875 commit 32aae92
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions a_sync/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def a_sync(
coro_fn: Callable[P, Awaitable[T]] = None, # type: ignore [misc]
default: Literal[None] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[P, Awaitable[T]]:... # type: ignore [misc]
Expand All @@ -41,10 +41,10 @@ def a_sync( # type: ignore [misc]
coro_fn: Callable[P, T] = None, # type: ignore [misc]
default: Literal[None] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
executor: Executor = config.default_sync_executor,
) -> Callable[P, T]:... # type: ignore [misc]

# @a_sync(default='async')
Expand All @@ -62,19 +62,19 @@ def a_sync(
coro_fn: Literal[None] = None,
default: Literal['async'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
executor: Executor = config.default_sync_executor,
) -> Callable[[Union[Callable[P, Awaitable[T]], Callable[P, T]]], Callable[P, Awaitable[T]]]:... # type: ignore [misc]

@overload # if you try to use default as the only arg
def a_sync(
coro_fn: Literal['async'] = None,
default: Literal[None] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[[Union[Callable[P, Awaitable[T]], Callable[P, T]]], Callable[P, Awaitable[T]]]:... # type: ignore [misc]
Expand All @@ -86,8 +86,8 @@ def a_sync(
coro_fn: Callable[P, Awaitable[T]] = None, # type: ignore [misc]
default: Literal['async'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[P, Awaitable[T]]:... # type: ignore [misc]
Expand All @@ -97,8 +97,8 @@ def a_sync( # type: ignore [misc]
coro_fn: Callable[P, T] = None, # type: ignore [misc]
default: Literal['async'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[P, Awaitable[T]]:... # type: ignore [misc]
Expand All @@ -110,8 +110,8 @@ def a_sync(
coro_fn: Callable[P, Awaitable[T]] = None, # type: ignore [misc]
default: Literal['sync'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[P, T]:... # type: ignore [misc]
Expand All @@ -121,8 +121,8 @@ def a_sync( # type: ignore [misc]
coro_fn: Callable[P, T] = None, # type: ignore [misc]
default: Literal['sync'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[P, T]:... # type: ignore [misc]
Expand All @@ -142,8 +142,8 @@ def a_sync( # type: ignore [misc]
coro_fn: Literal[None] = None,
default: Literal['sync'] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[[Union[Callable[P, Awaitable[T]], Callable[P, T]]], Callable[P, T]]:... # type: ignore [misc]
Expand All @@ -153,8 +153,8 @@ def a_sync(
coro_fn: Literal['sync'] = None,
default: Literal[None] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Callable[[Union[Callable[P, Awaitable[T]], Callable[P, T]]], Callable[P, T]]:... # type: ignore [misc]
Expand All @@ -164,8 +164,8 @@ def a_sync(
coro_fn: Optional[Union[Callable[P, Awaitable[T]], Callable[P, T]]] = None, # type: ignore [misc]
default: Literal['sync', 'async', None] = None,
# async settings
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
runs_per_minute: Optional[int] = None,
_async_semaphore: semaphores.SemaphoreSpec = semaphores.dummy_semaphore,
# sync settings
sync_executor: Executor = config.default_sync_executor,
) -> Union[ # type: ignore [misc]
Expand Down

0 comments on commit 32aae92

Please sign in to comment.