diff options
author | Roy Wellington Ⅳ <roy@mybasis.com> | 2015-03-31 14:44:10 -0700 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2015-12-29 17:55:29 +0200 |
commit | 2aa80748f6123aa95f752353263c6ca2567b735e (patch) | |
tree | 342bc2d30fe162ea57426c048b35acb7c228c4a4 /babel/core.py | |
parent | 5d0c4ef8a55bc507650e9ff750328883d371d5c3 (diff) | |
download | babel-2aa80748f6123aa95f752353263c6ca2567b735e.tar.gz |
Add __hash__ to Locale.
Diffstat (limited to 'babel/core.py')
-rw-r--r-- | babel/core.py | 3 |
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'): |