Skip to content

Commit

Permalink
Fixes to add to 2.5.1 (#8110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sydney-runkle committed Nov 14, 2023
1 parent 0564c0d commit e5e47d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Expand Up @@ -21,6 +21,7 @@ The code released in v2.5.0 is functionally identical to that of v2.5.0b1.
* Added `validation_error_cause` to config by @zakstucke in [#7626](https://github.com/pydantic/pydantic/pull/7626)
* Make path of the item to validate available in plugin by @hramezani in [#7861](https://github.com/pydantic/pydantic/pull/7861)
* Add `CallableDiscriminator` and `Tag` by @dmontagu in [#7983](https://github.com/pydantic/pydantic/pull/7983)
* `CallableDiscriminator` renamed to `Discriminator` by @dmontagu in [#8047](https://github.com/pydantic/pydantic/pull/8047)
* Make union case tags affect union error messages by @dmontagu in [#8001](https://github.com/pydantic/pydantic/pull/8001)
* Add `examples` and `json_schema_extra` to `@computed_field` by @alexmojaki in [#8013](https://github.com/pydantic/pydantic/pull/8013)
* Add `JsonValue` type by @dmontagu in [#7998](https://github.com/pydantic/pydantic/pull/7998)
Expand Down
11 changes: 9 additions & 2 deletions pydantic/_internal/_validate_call.py
Expand Up @@ -145,5 +145,12 @@ def __set_name__(self, owner: Any, name: str) -> None:
def __repr__(self) -> str:
return f'ValidateCallWrapper({self.raw_function})'

def __eq__(self, other):
return self.raw_function == other.raw_function
def __eq__(self, other) -> bool:
return (
(self.raw_function == other.raw_function)
and (self._config == other._config)
and (self._validate_return == other._validate_return)
)

def __hash__(self):
return hash(self.raw_function)

0 comments on commit e5e47d8

Please sign in to comment.