diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-23 23:44:49 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-24 00:06:55 +0200 |
commit | b999cae064fb6ac11a61a39856e074341baeefde (patch) | |
tree | 853234aec20b28092832e346a958a422ff68deb2 /lib/git/actor.py | |
parent | 0cd09bd306486028f5442c56ef2e947355a06282 (diff) | |
download | gitpython-b999cae064fb6ac11a61a39856e074341baeefde.tar.gz |
actor: added __eq__, __ne__ and __hash__ methods including simple test
commit: Fixed long-standing issue during message parsing that would fail to parse properly in case we were created from data. Also it would strip white space from the messages although it shouldn't
Diffstat (limited to 'lib/git/actor.py')
-rw-r--r-- | lib/git/actor.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/git/actor.py b/lib/git/actor.py index fe4a47e5..04872f1c 100644 --- a/lib/git/actor.py +++ b/lib/git/actor.py @@ -18,6 +18,15 @@ class Actor(object): self.name = name self.email = email + def __eq__(self, other): + return self.name == other.name and self.email == other.email + + def __ne__(self, other): + return not (self == other) + + def __hash__(self): + return hash((self.name, self.email)) + def __str__(self): return self.name |