Skip to content

Commit a4cd5fa

Browse files
committed
change
1 parent 50b33bf commit a4cd5fa

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

pydantic/main.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,15 +1174,7 @@ def __eq__(self, other: Any) -> bool:
11741174
self_type is other_type
11751175
and getattr(self, '__pydantic_private__', None) == getattr(other, '__pydantic_private__', None)
11761176
# We need to assume `None` and `{}` are equivalent, because extra behavior
1177-
# can be controlled at validation time.
1178-
# Bit of a premature optimization, but this is slightly faster than
1179-
# `(self.__pydantic_extra__ or {}) == (other.__pydantic_extra__ or {})`
1180-
# and (
1181-
# (self.__pydantic_extra__ is None and other.__pydantic_extra__ is None)
1182-
# or (self.__pydantic_extra__ is None and other.__pydantic_extra__ == {})
1183-
# or (other.__pydantic_extra__ is None and self.__pydantic_extra__ == {})
1184-
# or (self.__pydantic_extra__ == other.__pydantic_extra__)
1185-
# )
1177+
# can be controlled at validation time:
11861178
and (self.__pydantic_extra__ or {}) == (other.__pydantic_extra__ or {})
11871179
):
11881180
return False

0 commit comments

Comments
 (0)