From 0f10ee81f85de62f22457eb0a48e404a2f600ffe Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 3 Dec 2021 05:53:53 +0000 Subject: [PATCH] Simplify __eq__ --- src/ini2toml/intermediate_repr.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ini2toml/intermediate_repr.py b/src/ini2toml/intermediate_repr.py index 001a5e6..3c068b3 100644 --- a/src/ini2toml/intermediate_repr.py +++ b/src/ini2toml/intermediate_repr.py @@ -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