diff options
| author | Ian Ward <ian@excess.org> | 2015-01-04 09:23:21 -0500 |
|---|---|---|
| committer | Ian Ward <ian@excess.org> | 2015-01-04 09:23:21 -0500 |
| commit | a02060ceeb5da89099c280a6a35030f4da2073f1 (patch) | |
| tree | 7b2c73cdb0b6b4ffeb462952bbae8d566f1f6ace /urwid | |
| parent | 5cc77824e2dec3284825e0b4e9870e6171ed98ab (diff) | |
| parent | d4dde8aeae644f6205cc65ff777ecd34cb27dc41 (diff) | |
| download | urwid-a02060ceeb5da89099c280a6a35030f4da2073f1.tar.gz | |
Merge pull request #91 from rndusr/master
Add equality operators to AttrSpec
Diffstat (limited to 'urwid')
| -rwxr-xr-x | urwid/display_common.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/urwid/display_common.py b/urwid/display_common.py index c3b9c5d..9a5646f 100755 --- a/urwid/display_common.py +++ b/urwid/display_common.py @@ -646,6 +646,13 @@ class AttrSpec(object): else: return vals + _COLOR_VALUES_256[self.background_number] + def __eq__(self, other): + return isinstance(other, AttrSpec) and self._value == other._value + + def __ne__(self, other): + return not self == other + + __hash__ = object.__hash__ class RealTerminal(object): |
