diff --git a/pebble/asynchronous/process.py b/pebble/asynchronous/process.py index f54e588..170a01e 100644 --- a/pebble/asynchronous/process.py +++ b/pebble/asynchronous/process.py @@ -22,7 +22,7 @@ from itertools import count from functools import wraps from concurrent.futures import TimeoutError -from typing import Any, Callable, Optional, Union, overload +from typing import Any, Callable, Optional, overload from pebble import common from pebble.pool.process import ProcessPool @@ -33,7 +33,6 @@ def process( func: Callable[[common.P], common.T] ) -> Callable[[common.P], asyncio.Future[common.T]]: ... - @overload def process( name: Optional[str] = None, @@ -44,11 +43,7 @@ def process( ) -> Callable[[Callable[[common.P], common.T]], Callable[[common.P], asyncio.Future[common.T]]]: ... - -def process( - *args: list, - **kwargs: dict -) -> Callable: +def process(*args, **kwargs): """Runs the decorated function in a concurrent process, taking care of the result and error management. diff --git a/pebble/asynchronous/thread.py b/pebble/asynchronous/thread.py index aed219c..5a23302 100644 --- a/pebble/asynchronous/thread.py +++ b/pebble/asynchronous/thread.py @@ -17,7 +17,7 @@ import asyncio from functools import wraps -from typing import Callable, Optional, Union, overload +from typing import Callable, Optional, overload from pebble import common from pebble.pool.thread import ThreadPool @@ -28,7 +28,6 @@ def thread( func: Callable[[common.P], common.T] ) -> Callable[[common.P], asyncio.Future[common.T]]: ... - @overload def thread( name: Optional[str] = None, @@ -37,11 +36,7 @@ def thread( ) -> Callable[[Callable[[common.P], common.T]], Callable[[common.P], asyncio.Future[common.T]]]: ... - -def thread( - *args: list, - **kwargs: dict -) -> Callable: +def thread(*args, **kwargs): """Runs the decorated function within a concurrent thread, taking care of the result and error management. diff --git a/pebble/concurrent/process.py b/pebble/concurrent/process.py index 59e6b2f..34ab1c4 100644 --- a/pebble/concurrent/process.py +++ b/pebble/concurrent/process.py @@ -21,7 +21,7 @@ from itertools import count from functools import wraps -from typing import Any, Callable, Optional, Union, overload +from typing import Any, Callable, Optional, overload from concurrent.futures import CancelledError, TimeoutError from pebble import common @@ -33,7 +33,6 @@ def process( func: Callable[[common.P], common.T] ) -> Callable[[common.P], common.ProcessFuture[common.T]]: ... - @overload def process( name: Optional[str] = None, @@ -44,13 +43,7 @@ def process( ) -> Callable[[Callable[[common.P], common.T]], Callable[[common.P], common.ProcessFuture[common.T]]]: ... - -def process( - *args: list, - **kwargs: dict -) -> Union[Callable[[common.P], common.ProcessFuture[common.T]], - Callable[[Callable[[common.P], common.T]], - Callable[[common.P], common.ProcessFuture[common.T]]]]: +def process(*args, **kwargs): """Runs the decorated function in a concurrent process, taking care of the result and error management. diff --git a/pebble/concurrent/thread.py b/pebble/concurrent/thread.py index b53d54b..fd3a423 100644 --- a/pebble/concurrent/thread.py +++ b/pebble/concurrent/thread.py @@ -26,7 +26,6 @@ def thread( func: Callable[[common.P], common.T] ) -> Callable[[common.P], Future[common.T]]: ... - @overload def thread( name: Optional[str] = None, @@ -35,13 +34,7 @@ def thread( ) -> Callable[[Callable[[common.P], common.T]], Callable[[common.P], Future[common.T]]]: ... - -def thread( - *args: list, - **kwargs: dict -) -> Union[Callable[[common.P], Future[common.T]], - Callable[[Callable[[common.P], common.T]], - Callable[[common.P], Future[common.T]]]]: +def thread(*args, **kwargs): """Runs the decorated function within a concurrent thread, taking care of the result and error management.