Add shortcut to context comparison

This commit is contained in:
Vgr E. Barry 2017-08-29 19:31:26 -04:00
parent 5fff9d2ce8
commit 371f8488df

View File

@ -128,6 +128,8 @@ class IRCContext:
def _compare(self, other, cls, *attributes):
"""Compare two instances and return a proper value."""
if self is other:
return True
if not isinstance(other, cls):
return NotImplemented