mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Now using hash(repr(self)) instead of hash(str(self)) in Python API
This commit is contained in:
parent
d26a86f5f1
commit
7be1b7a609
8 changed files with 12 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue