Skip to content

Commit

Permalink
mypy: ensure default are set in overloaded methods (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-quix authored Jan 6, 2025
1 parent 7d67658 commit c03a9e8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions quixstreams/core/stream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __repr__(self) -> str:
return f"<{self.__class__.__name__} [{len(tree_funcs)}]: {funcs_repr}>"

@overload
def add_filter(self, func: FilterCallback, *, metadata: Literal[False]):
def add_filter(self, func: FilterCallback, *, metadata: Literal[False] = False):
pass

@overload
Expand Down Expand Up @@ -149,7 +149,11 @@ def add_filter(

@overload
def add_apply(
self, func: ApplyCallback, *, expand: Literal[False], metadata: Literal[False]
self,
func: ApplyCallback,
*,
expand: Literal[False] = False,
metadata: Literal[False] = False,
):
pass

Expand All @@ -159,7 +163,7 @@ def add_apply(
func: ApplyExpandedCallback,
*,
expand: Literal[True],
metadata: Literal[False],
metadata: Literal[False] = False,
):
pass

Expand All @@ -168,7 +172,7 @@ def add_apply(
self,
func: ApplyWithMetadataCallback,
*,
expand: Literal[False],
expand: Literal[False] = False,
metadata: Literal[True],
):
pass
Expand Down Expand Up @@ -217,7 +221,7 @@ def add_apply(
return self._add(apply_func)

@overload
def add_update(self, func: UpdateCallback, *, metadata: Literal[False]):
def add_update(self, func: UpdateCallback, *, metadata: Literal[False] = False):
pass

@overload
Expand Down Expand Up @@ -251,7 +255,7 @@ def add_update(
return self._add(update_func)

@overload
def add_transform(self, func: TransformCallback, *, expand: Literal[False]):
def add_transform(self, func: TransformCallback, *, expand: Literal[False] = False):
pass

@overload
Expand Down

0 comments on commit c03a9e8

Please # to comment.