Skip to content

Commit

Permalink
py3k: Make CFVariable hashable.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Sep 7, 2015
1 parent 3c5f540 commit 5194a31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/iris/fileformats/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ def __ne__(self, other):
# CF variable names are unique.
return self.cf_name != other.cf_name

def __hash__(self):
# CF variable names are unique.
return hash(self.cf_name)

def __getattr__(self, name):
# Accessing netCDF attributes is surprisingly slow. Since
# they're often read repeatedly, caching the values makes things
Expand Down

0 comments on commit 5194a31

Please sign in to comment.