Skip to content

Commit 0c78234

Browse files
authored
Merge pull request #138 from moomoohk/master
Make HumanName objects hashable
2 parents ab8e5b5 + 3ae1f2a commit 0c78234

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name: Test the Python package
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches: [ master ]
910
pull_request:

nameparser/parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ def __unicode__(self):
141141
return self.collapse_whitespace(_s).strip(', ')
142142
return " ".join(self)
143143

144+
def __hash__(self):
145+
return hash(str(self))
146+
144147
def __str__(self):
145148
if sys.version_info[0] >= 3:
146149
return self.__unicode__()

0 commit comments

Comments
 (0)