Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions jsonobject/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ def __getstate__(self):
def __setstate__(self, dct):
self.__init__(dct)

def __eq__(self, other: object) -> bool:
if not isinstance(other, JsonObject):
raise TypeError(
"Expected an argument of type JsonObject, got: {}".format(type(other))
)
return sorted(self.items()) == sorted(other.items())

class Meta(object):
properties = {
decimal.Decimal: properties.DecimalProperty,
Expand Down