| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b5c834a commit eb15123
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1214,9 +1214,7 @@ def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_Iterabl | |||
| 1214 | 1214 | raise ValueError("Index should be an int or str") | |
| 1215 | 1215 | else: | |
| 1216 | 1216 | try: | |
| 1217 | - if not isinstance(index, str): | ||
| 1218 | - raise AttributeError(f"{index} is not a valid attribute") | ||
| 1219 | - return getattr(self, index) | ||
| 1217 | + return getattr(self, cast(str, index)) | ||
| 1220 | 1218 | except AttributeError as e: | |
| 1221 | 1219 | raise IndexError(f"No item found with id {self._prefix}{index}") from e | |
| 1222 | 1220 | # END handle getattr | |
| Back | FazBrowse Home | New Git URL |
0 commit comments