From 8dc75521bd42db19d41e8d92ce5204dfe1a594ac Mon Sep 17 00:00:00 2001 From: Gordon Marx Date: Thu, 22 May 2025 15:48:54 -0400 Subject: [PATCH] remove type assertions from util.py --- git/util.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/git/util.py b/git/util.py index 9e8ac821d..0d09c3f09 100644 --- a/git/util.py +++ b/git/util.py @@ -1200,8 +1200,6 @@ def __getattr__(self, attr: str) -> T_IterableObj: return list.__getattribute__(self, attr) def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_IterableObj: # type: ignore[override] - assert isinstance(index, (int, str, slice)), "Index of IterableList should be an int or str" - if isinstance(index, int): return list.__getitem__(self, index) elif isinstance(index, slice): @@ -1214,8 +1212,6 @@ def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_Iterabl # END handle getattr def __delitem__(self, index: Union[SupportsIndex, int, slice, str]) -> None: - assert isinstance(index, (int, str)), "Index of IterableList should be an int or str" - delindex = cast(int, index) if not isinstance(index, int): delindex = -1