Merge "Add __hash__ functions where necessary"
This commit is contained in:
commit
2422dfcd30
|
@ -125,6 +125,9 @@ class Function(object):
|
|||
return NotImplemented
|
||||
return not eq
|
||||
|
||||
def __hash__(self):
|
||||
return id(self)
|
||||
|
||||
|
||||
def resolve(snippet):
|
||||
while isinstance(snippet, Function):
|
||||
|
|
|
@ -299,6 +299,9 @@ class Resource(object):
|
|||
return result
|
||||
return not result
|
||||
|
||||
def __hash__(self):
|
||||
return id(self)
|
||||
|
||||
def metadata_get(self, refresh=False):
|
||||
if refresh:
|
||||
self._rsrc_metadata = None
|
||||
|
|
|
@ -395,6 +395,13 @@ class ResourceDefinition(ResourceDefinitionCore, collections.Mapping):
|
|||
|
||||
raise KeyError(key)
|
||||
|
||||
def __hash__(self):
|
||||
"""
|
||||
Return a hash of the ResourceDefinition object.
|
||||
"""
|
||||
warnings.warn(self._deprecation_msg, DeprecationWarning)
|
||||
return super(ResourceDefinition, self).__hash__()
|
||||
|
||||
def __len__(self):
|
||||
"""
|
||||
Return the number of available CFN template keys.
|
||||
|
|
|
@ -126,6 +126,9 @@ class PhysName(object):
|
|||
# ignore the stack portion of the name, as it may have been truncated
|
||||
return res == self.res
|
||||
|
||||
def __hash__(self):
|
||||
return id(self)
|
||||
|
||||
def __ne__(self, physical_name):
|
||||
return not self.__eq__(physical_name)
|
||||
|
||||
|
|
Loading…
Reference in New Issue