Skip to content

Commit ac30a66

Browse files
committed
Implement '==' and '!=' for ynbool
'ynbool(True) == "yes"', 'ynbool(True) == True' and 'ynbool(True) == ynbool(True)' were not working.
1 parent c42fe53 commit ac30a66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mpv.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def __str__(self):
259259
def __repr__(self):
260260
return str(self.val)
261261

262+
def __eq__(self, other):
263+
return str(self) == other or bool(self) == other
264+
262265
def _ensure_encoding(possibly_bytes):
263266
return possibly_bytes.decode() if type(possibly_bytes) is bytes else possibly_bytes
264267

0 commit comments

Comments
 (0)