Now using hash(repr(self)) instead of hash(str(self)) in Python API

This commit is contained in:
wbinventor@gmail.com 2015-12-01 10:13:37 -05:00
parent d26a86f5f1
commit 7be1b7a609
8 changed files with 12 additions and 12 deletions

View file

@ -52,7 +52,7 @@ class CrossScore(object):
self.binary_op = binary_op
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __eq__(self, other):
return str(other) == str(self)
@ -152,7 +152,7 @@ class CrossNuclide(object):
self.binary_op = binary_op
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __eq__(self, other):
return str(other) == str(self)

View file

@ -58,7 +58,7 @@ class Element(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Element - {0}\n'.format(self._name)

View file

@ -81,7 +81,7 @@ class Filter(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __deepcopy__(self, memo):
existing = memo.get(id(self))

View file

@ -108,7 +108,7 @@ class Material(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Material\n'

View file

@ -190,7 +190,7 @@ class Mesh(object):
self._width = width
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Mesh\n'

View file

@ -61,7 +61,7 @@ class Nuclide(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Nuclide - {0}\n'.format(self._name)

View file

@ -190,7 +190,7 @@ class Tally(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Tally\n'

View file

@ -95,7 +95,7 @@ class Cell(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Cell\n'
@ -483,7 +483,7 @@ class Universe(object):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'Universe\n'
@ -971,7 +971,7 @@ class RectLattice(Lattice):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'RectLattice\n'
@ -1208,7 +1208,7 @@ class HexLattice(Lattice):
return not self == other
def __hash__(self):
return hash(str(self))
return hash(repr(self))
def __repr__(self):
string = 'HexLattice\n'