Skip to content

Commit

Permalink
Simplify __eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Dec 3, 2021
1 parent 18c33da commit 0f10ee8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ini2toml/intermediate_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ def __init__(
self.comment = comment

def __eq__(self, other):
if self.__class__ != other.__class__:
return False
return self.value == other.value and self.comment == other.comment
return (
self.__class__ is other.__class__
and self.value == other.value
and self.comment == other.comment
)

def comment_only(self):
return self.value is NOT_GIVEN
Expand Down

0 comments on commit 0f10ee8

Please sign in to comment.