Skip to content

Commit 8ce4b7e

Browse files
committed
Make joystick class comparing more strict.
I'm worried about comparing these across classes. I might relax this compare again in the future.
1 parent 2b8388f commit 8ce4b7e

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tcod/sdl/joystick.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ def _from_instance_id(cls, instance_id: int) -> Joystick:
153153
return cls(_check_p(ffi.gc(lib.SDL_JoystickFromInstanceID(instance_id), lib.SDL_JoystickClose)))
154154

155155
def __eq__(self, other: object) -> bool:
156-
if isinstance(other, GameController):
157-
return self == other.joystick.id
158156
if isinstance(other, Joystick):
159157
return self.id == other.id
160158
return NotImplemented
@@ -222,8 +220,6 @@ def get_axis(self, axis: ControllerAxis) -> int:
222220
def __eq__(self, other: object) -> bool:
223221
if isinstance(other, GameController):
224222
return self.joystick.id == other.joystick.id
225-
if isinstance(other, Joystick):
226-
return self.joystick.id == other.id
227223
return NotImplemented
228224

229225
def __hash__(self) -> int:

0 commit comments

Comments
 (0)