Skip to content

Commit 77cd8ee

Browse files
committed
Removed a couple cast() calls which were no longer needed
1 parent 9699b2b commit 77cd8ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎cmd2/cmd2.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5950,7 +5950,7 @@ def register_postloop_hook(self, func: Callable[[], None]) -> None:
59505950
@classmethod
59515951
def _validate_postparsing_callable(cls, func: Callable[[plugin.PostparsingData], plugin.PostparsingData]) -> None:
59525952
"""Check parameter and return types for postparsing hooks."""
5953-
cls._validate_callable_param_count(cast(Callable[..., Any], func), 1)
5953+
cls._validate_callable_param_count(func, 1)
59545954
type_hints, ret_ann = get_types(func)
59555955
func_name = getattr(func, "__name__", "hook")
59565956
if not type_hints:
@@ -5974,7 +5974,7 @@ def _validate_prepostcmd_hook(
59745974
) -> None:
59755975
"""Check parameter and return types for pre and post command hooks."""
59765976
# validate that the callable has the right number of parameters
5977-
cls._validate_callable_param_count(cast(Callable[..., Any], func), 1)
5977+
cls._validate_callable_param_count(func, 1)
59785978

59795979
type_hints, ret_ann = get_types(func)
59805980
func_name = getattr(func, "__name__", "hook")

0 commit comments

Comments
 (0)