Skip to content

Commit

Permalink
fix Schema.__eq__ to deal with dicts properly (fixes #315)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtao committed Dec 6, 2017
1 parent 52a3a71 commit be867c5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions voluptuous/schema_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,9 @@ def value_to_schema_type(value):
return cls(value_to_schema_type(data), **kwargs)

def __eq__(self, other):
if str(other) == str(self.schema):
# Because repr is combination mixture of object and schema
return True
return False
if not isinstance(other, Schema):
return False
return other.schema == self.schema

def __str__(self):
return str(self.schema)
Expand Down

0 comments on commit be867c5

Please sign in to comment.