summaryrefslogtreecommitdiff
path: root/babel/core.py
diff options
context:
space:
mode:
authorRoy Wellington Ⅳ <roy@mybasis.com>2015-03-31 14:44:10 -0700
committerAarni Koskela <akx@iki.fi>2015-12-29 17:55:29 +0200
commit2aa80748f6123aa95f752353263c6ca2567b735e (patch)
tree342bc2d30fe162ea57426c048b35acb7c228c4a4 /babel/core.py
parent5d0c4ef8a55bc507650e9ff750328883d371d5c3 (diff)
downloadbabel-2aa80748f6123aa95f752353263c6ca2567b735e.tar.gz
Add __hash__ to Locale.
Diffstat (limited to 'babel/core.py')
-rw-r--r--babel/core.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/babel/core.py b/babel/core.py
index 84ee189..2df139c 100644
--- a/babel/core.py
+++ b/babel/core.py
@@ -326,6 +326,9 @@ class Locale(object):
def __ne__(self, other):
return not self.__eq__(other)
+ def __hash__(self):
+ return hash((self.language, self.territory, self.script, self.variant))
+
def __repr__(self):
parameters = ['']
for key in ('territory', 'script', 'variant'):