Skip to content

Commit 2fc19ef

Browse files
committed
Make __eq__ method more generic
1 parent 49bb2ba commit 2fc19ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

evdev/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def set_led(self, led_num, value):
233233

234234
def __eq__(self, other):
235235
'''Two devices are equal if their :data:`info` attributes are equal.'''
236-
return isinstance(other, InputDevice) and self.info == other.info
236+
return isinstance(other, self.__class__) and self.info == other.info
237237

238238
def __str__(self):
239239
msg = 'device {}, name "{}", phys "{}"'

0 commit comments

Comments
 (0)