diff --git a/BaseClasses.py b/BaseClasses.py index ef0fa10e..c4fff017 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -1156,13 +1156,13 @@ class Region: self.region_manager = region_manager def __getitem__(self, index: int) -> Location: - return self._list.__getitem__(index) + return self._list[index] def __setitem__(self, index: int, value: Location) -> None: raise NotImplementedError() def __len__(self) -> int: - return self._list.__len__() + return len(self._list) def __iter__(self): return iter(self._list) @@ -1176,8 +1176,8 @@ class Region: class LocationRegister(Register): def __delitem__(self, index: int) -> None: - location: Location = self._list.__getitem__(index) - self._list.__delitem__(index) + location: Location = self._list[index] + del self._list[index] del(self.region_manager.location_cache[location.player][location.name]) def insert(self, index: int, value: Location) -> None: @@ -1188,8 +1188,8 @@ class Region: class EntranceRegister(Register): def __delitem__(self, index: int) -> None: - entrance: Entrance = self._list.__getitem__(index) - self._list.__delitem__(index) + entrance: Entrance = self._list[index] + del self._list[index] del(self.region_manager.entrance_cache[entrance.player][entrance.name]) def insert(self, index: int, value: Entrance) -> None: diff --git a/CommonClient.py b/CommonClient.py index 35ed541f..454150ac 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -211,7 +211,7 @@ class CommonContext: return iter(self._game_store) def __repr__(self) -> str: - return self._game_store.__repr__() + return repr(self._game_store) def lookup_in_game(self, code: int, game_name: typing.Optional[str] = None) -> str: """Returns the name for an item/location id in the context of a specific game or own game if `game` is diff --git a/Options.py b/Options.py index 26e14592..b910d216 100644 --- a/Options.py +++ b/Options.py @@ -865,13 +865,13 @@ class OptionDict(Option[typing.Dict[str, typing.Any]], VerifyKeys, typing.Mappin return ", ".join(f"{key}: {v}" for key, v in value.items()) def __getitem__(self, item: str) -> typing.Any: - return self.value.__getitem__(item) + return self.value[item] def __iter__(self) -> typing.Iterator[str]: - return self.value.__iter__() + return iter(self.value) def __len__(self) -> int: - return self.value.__len__() + return len(self.value) # __getitem__ fallback fails for Counters, so we define this explicitly def __contains__(self, item) -> bool: @@ -1067,10 +1067,10 @@ class PlandoTexts(Option[typing.List[PlandoText]], VerifyKeys): yield from self.value def __getitem__(self, index: typing.SupportsIndex) -> PlandoText: - return self.value.__getitem__(index) + return self.value[index] def __len__(self) -> int: - return self.value.__len__() + return len(self.value) class ConnectionsMeta(AssembleOptions): @@ -1217,7 +1217,7 @@ class PlandoConnections(Option[typing.List[PlandoConnection]], metaclass=Connect connection.exit) for connection in value]) def __getitem__(self, index: typing.SupportsIndex) -> PlandoConnection: - return self.value.__getitem__(index) + return self.value[index] def __iter__(self) -> typing.Iterator[PlandoConnection]: yield from self.value