Cleaned up gene comparison method
This commit is contained in:
@ -16,13 +16,7 @@ class Gene:
|
|||||||
|
|
||||||
def __eq__(self, other_gene):
|
def __eq__(self, other_gene):
|
||||||
"""Comparing two genes by their value."""
|
"""Comparing two genes by their value."""
|
||||||
|
return self.value == Gene(other_value).value
|
||||||
try:
|
|
||||||
other_value = other_gene.value
|
|
||||||
except:
|
|
||||||
other_value = other_gene
|
|
||||||
|
|
||||||
return self.value == other_value
|
|
||||||
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user