Skip to content

Commit

Permalink
style: Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine-addictt committed Apr 21, 2024
1 parent a288a3d commit 5750f33
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
9 changes: 6 additions & 3 deletions src/thread/decorators/_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
@overload
def processor(
__function: TargetFunction[_DataT, _TargetP, _TargetT],
) -> NoParamReturn[_DataT, _TargetP, _TargetT]: ...
) -> NoParamReturn[_DataT, _TargetP, _TargetT]:
...


@overload
Expand All @@ -55,7 +56,8 @@ def processor(
ignore_errors: Sequence[type[Exception]] = (),
suppress_errors: bool = False,
**overflow_kwargs: Overflow_In,
) -> WithParamReturn[_DataT, _TargetP, _TargetT]: ...
) -> WithParamReturn[_DataT, _TargetP, _TargetT]:
...


@overload
Expand All @@ -67,7 +69,8 @@ def processor(
ignore_errors: Sequence[type[Exception]] = (),
suppress_errors: bool = False,
**overflow_kwargs: Overflow_In,
) -> FullParamReturn[_DataT, _TargetP, _TargetT]: ...
) -> FullParamReturn[_DataT, _TargetP, _TargetT]:
...


def processor(
Expand Down
9 changes: 6 additions & 3 deletions src/thread/decorators/_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@


@overload
def threaded(__function: TargetFunction[P, T]) -> NoParamReturn[P, T]: ...
def threaded(__function: TargetFunction[P, T]) -> NoParamReturn[P, T]:
...


@overload
Expand All @@ -34,7 +35,8 @@ def threaded(
ignore_errors: Sequence[type[Exception]] = (),
suppress_errors: bool = False,
**overflow_kwargs: Overflow_In,
) -> WithParamReturn[P, T]: ...
) -> WithParamReturn[P, T]:
...


@overload
Expand All @@ -46,7 +48,8 @@ def threaded(
ignore_errors: Sequence[type[Exception]] = (),
suppress_errors: bool = False,
**overflow_kwargs: Overflow_In,
) -> FullParamReturn[P, T]: ...
) -> FullParamReturn[P, T]:
...


def threaded(
Expand Down
12 changes: 8 additions & 4 deletions src/thread/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ def __init__(
_get_value: Optional[Callable[[LengthandGetLike_T, int], _Dataset_T]] = None,
_length: Optional[Union[int, Callable[[Any], int]]] = None,
**overflow_kwargs: Overflow_In,
) -> None: ...
) -> None:
...

# Has __len__, require _get_value to be set
@overload
Expand All @@ -386,7 +387,8 @@ def __init__(
_get_value: Callable[[LengthLike_T, int], _Dataset_T],
_length: Optional[Union[int, Callable[[Any], int]]] = None,
**overflow_kwargs: Overflow_In,
) -> None: ...
) -> None:
...

# Has __getitem__, require _length to be set
@overload
Expand All @@ -399,7 +401,8 @@ def __init__(
_get_value: Optional[Callable[[GetLike_T, int], _Dataset_T]] = None,
_length: Union[int, Callable[[GetLike_T], int]],
**overflow_kwargs: Overflow_In,
) -> None: ...
) -> None:
...

# Does not support __getitem__ and __len__
@overload
Expand All @@ -412,7 +415,8 @@ def __init__(
_get_value: Callable[[Any, int], _Dataset_T],
_length: Union[int, Callable[[Any], int]],
**overflow_kwargs: Overflow_In,
) -> None: ...
) -> None:
...

def __init__(
self,
Expand Down
7 changes: 5 additions & 2 deletions tests/test_dataframe_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ def __init__(self, length: typing.Any, dataset: list):


class DummyUnlikeSequence1:
def __init__(self) -> None: ...
def __init__(self) -> None:
...


class DummyUnlikeSequence2:
def __init__(self) -> None: ...
def __init__(self) -> None:
...

def __str__(self) -> str:
return 'invalid'

Expand Down

0 comments on commit 5750f33

Please sign in to comment.