remove type assertions from util.py by gcmarx · Pull Request #2028 · gitpython-developers/GitPython
Expand Up
@@ -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): Expand All @@ -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 Expand Down
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): Expand All @@ -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 Expand Down