We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`CallableDiscriminator` isn't in the docs -- note in release notes (it's `Discriminator`)
### Initial Checks

- [X] I have searched Google & GitHub for similar requests and couldn't find anything
- [X] I have read and followed [the docs](https://docs.pydantic.dev) and still think this feature is missing

### Description

It's a trap!

The release notes for 2.5.0 say `CallableDiscriminator`, but the class was renamed to `Discriminator` before release - so searching the docs for "CallableDiscriminator" doesn't find it.

Maybe worth a note in the line of the release notes to indicate it is now called `Discriminator` to direct users to this cool new feature.

### Affected Components

- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
- [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)
- [ ] [Data serialization](https://docs.pydantic.dev/concepts/serialization/) - `.model_dump()` and `.model_dump_json()`
- [ ] [JSON Schema](https://docs.pydantic.dev/concepts/json_schema/)
- [ ] [Dataclasses](https://docs.pydantic.dev/concepts/dataclasses/)
- [ ] [Model Config](https://docs.pydantic.dev/concepts/config/)
- [ ] [Field Types](https://docs.pydantic.dev/api/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://docs.pydantic.dev/concepts/validation_decorator/)
- [ ] [Generic Models](https://docs.pydantic.dev/concepts/models/#generic-models)
- [ ] [Other Model behaviour](https://docs.pydantic.dev/concepts/models/) - `model_construct()`, pickling, private attributes, ORM mode
- [ ] [Plugins](https://docs.pydantic.dev/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pydantic/_internal/_validate_call.py`
Content:
```
1 from __future__ import annotations as _annotations
2 
3 import inspect
4 from dataclasses import dataclass
5 from functools import partial
6 from typing import Any, Awaitable, Callable
7 
8 import pydantic_core
9 
10 from ..config import ConfigDict
11 from ..plugin._schema_validator import create_schema_validator
12 from . import _generate_schema, _typing_extra
13 from ._config import ConfigWrapper
14 
15 
16 @dataclass
17 class CallMarker:
18     function: Callable[..., Any]
19     validate_return: bool
20 
21 
22 class ValidateCallWrapper:
23     """This is a wrapper around a function that validates the arguments passed to it, and optionally the return value.
24 
25     It's partially inspired by `wraps` which in turn uses `partial`, but extended to be a descriptor so
26     these functions can be applied to instance methods, class methods, static methods, as well as normal functions.
27     """
28 
29     __slots__ = (
30         'raw_function',
31         '_config',
32         '_validate_return',
33         '__pydantic_core_schema__',
34         '__pydantic_validator__',
35         '__signature__',
36         '__name__',
37         '__qualname__',
38         '__annotations__',
39         '__dict__',  # required for __module__
40     )
41 
42     def __init__(self, function: Callable[..., Any], config: ConfigDict | None, validate_return: bool):
43         self.raw_function = function
44         self._config = config
45         self._validate_return = validate_return
46         self.__signature__ = inspect.signature(function)
47         if isinstance(function, partial):
48             func = function.func
49             schema_type = func
50             self.__name__ = f'partial({func.__name__})'
51             self.__qualname__ = f'partial({func.__qualname__})'
52             self.__annotations__ = func.__annotations__
53             self.__module__ = func.__module__
54             self.__doc__ = func.__doc__
55         else:
56             schema_type = function
57             self.__name__ = function.__name__
58             self.__qualname__ = function.__qualname__
59             self.__annotations__ = function.__annotations__
60             self.__module__ = function.__module__
61             self.__doc__ = function.__doc__
62 
63         namespace = _typing_extra.add_module_globals(function, None)
64         config_wrapper = ConfigWrapper(config)
65         gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)
66         schema = gen_schema.clean_schema(gen_schema.generate_schema(function))
67         self.__pydantic_core_schema__ = schema
68         core_config = config_wrapper.core_config(self)
69 
70         self.__pydantic_validator__ = create_schema_validator(
71             schema,
72             schema_type,
73             self.__module__,
74             self.__qualname__,
75             'validate_call',
76             core_config,
77             config_wrapper.plugin_settings,
78         )
79 
80         if self._validate_return:
81             return_type = (
82                 self.__signature__.return_annotation
83                 if self.__signature__.return_annotation is not self.__signature__.empty
84                 else Any
85             )
86             gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)
87             schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type))
88             self.__return_pydantic_core_schema__ = schema
89             validator = create_schema_validator(
90                 schema,
91                 schema_type,
92                 self.__module__,
93                 self.__qualname__,
94                 'validate_call',
95                 core_config,
96                 config_wrapper.plugin_settings,
97             )
98             if inspect.iscoroutinefunction(self.raw_function):
99 
100                 async def return_val_wrapper(aw: Awaitable[Any]) -> None:
101                     return validator.validate_python(await aw)
102 
103                 self.__return_pydantic_validator__ = return_val_wrapper
104             else:
105                 self.__return_pydantic_validator__ = validator.validate_python
106         else:
107             self.__return_pydantic_core_schema__ = None
108             self.__return_pydantic_validator__ = None
109 
110         self._name: str | None = None  # set by __get__, used to set the instance attribute when decorating methods
111 
112     def __call__(self, *args: Any, **kwargs: Any) -> Any:
113         res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
114         if self.__return_pydantic_validator__:
115             return self.__return_pydantic_validator__(res)
116         return res
117 
118     def __get__(self, obj: Any, objtype: type[Any] | None = None) -> ValidateCallWrapper:
119         """Bind the raw function and return another ValidateCallWrapper wrapping that."""
120         if obj is None:
121             try:
122                 # Handle the case where a method is accessed as a class attribute
123                 return objtype.__getattribute__(objtype, self._name)  # type: ignore
124             except AttributeError:
125                 # This will happen the first time the attribute is accessed
126                 pass
127 
128         bound_function = self.raw_function.__get__(obj, objtype)
129         result = self.__class__(bound_function, self._config, self._validate_return)
130 
131         # skip binding to instance when obj or objtype has __slots__ attribute
132         if hasattr(obj, '__slots__') or hasattr(objtype, '__slots__'):
133             return result
134 
135         if self._name is not None:
136             if obj is not None:
137                 object.__setattr__(obj, self._name, result)
138             else:
139                 object.__setattr__(objtype, self._name, result)
140         return result
141 
142     def __set_name__(self, owner: Any, name: str) -> None:
143         self._name = name
144 
145     def __repr__(self) -> str:
146         return f'ValidateCallWrapper({self.raw_function})'
147 
148     def __eq__(self, other):
149         return self.raw_function == other.raw_function
150
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pydantic/_internal/_validate_call.py b/pydantic/_internal/_validate_call.py
--- a/pydantic/_internal/_validate_call.py
+++ b/pydantic/_internal/_validate_call.py
@@ -145,5 +145,12 @@
     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)

{"golden_diff": "diff --git a/pydantic/_internal/_validate_call.py b/pydantic/_internal/_validate_call.py\n--- a/pydantic/_internal/_validate_call.py\n+++ b/pydantic/_internal/_validate_call.py\n@@ -145,5 +145,12 @@\n     def __repr__(self) -> str:\n         return f'ValidateCallWrapper({self.raw_function})'\n \n-    def __eq__(self, other):\n-        return self.raw_function == other.raw_function\n+    def __eq__(self, other) -> bool:\n+        return (\n+            (self.raw_function == other.raw_function)\n+            and (self._config == other._config)\n+            and (self._validate_return == other._validate_return)\n+        )\n+\n+    def __hash__(self):\n+        return hash(self.raw_function)\n", "issue": "`CallableDiscriminator` isn't in the docs -- note in release notes (it's `Discriminator`)\n### Initial Checks\n\n- [X] I have searched Google & GitHub for similar requests and couldn't find anything\n- [X] I have read and followed [the docs](https://docs.pydantic.dev) and still think this feature is missing\n\n### Description\n\nIt's a trap!\r\n\r\nThe release notes for 2.5.0 say `CallableDiscriminator`, but the class was renamed to `Discriminator` before release - so searching the docs for \"CallableDiscriminator\" doesn't find it.\r\n\r\nMaybe worth a note in the line of the release notes to indicate it is now called `Discriminator` to direct users to this cool new feature.\n\n### Affected Components\n\n- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)\n- [ ] [Data validation/parsing](https://docs.pydantic.dev/concepts/models/#basic-model-usage)\n- [ ] [Data serialization](https://docs.pydantic.dev/concepts/serialization/) - `.model_dump()` and `.model_dump_json()`\n- [ ] [JSON Schema](https://docs.pydantic.dev/concepts/json_schema/)\n- [ ] [Dataclasses](https://docs.pydantic.dev/concepts/dataclasses/)\n- [ ] [Model Config](https://docs.pydantic.dev/concepts/config/)\n- [ ] [Field Types](https://docs.pydantic.dev/api/types/) - adding or changing a particular data type\n- [ ] [Function validation decorator](https://docs.pydantic.dev/concepts/validation_decorator/)\n- [ ] [Generic Models](https://docs.pydantic.dev/concepts/models/#generic-models)\n- [ ] [Other Model behaviour](https://docs.pydantic.dev/concepts/models/) - `model_construct()`, pickling, private attributes, ORM mode\n- [ ] [Plugins](https://docs.pydantic.dev/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.\n", "before_files": [{"content": "from __future__ import annotations as _annotations\n\nimport inspect\nfrom dataclasses import dataclass\nfrom functools import partial\nfrom typing import Any, Awaitable, Callable\n\nimport pydantic_core\n\nfrom ..config import ConfigDict\nfrom ..plugin._schema_validator import create_schema_validator\nfrom . import _generate_schema, _typing_extra\nfrom ._config import ConfigWrapper\n\n\n@dataclass\nclass CallMarker:\n    function: Callable[..., Any]\n    validate_return: bool\n\n\nclass ValidateCallWrapper:\n    \"\"\"This is a wrapper around a function that validates the arguments passed to it, and optionally the return value.\n\n    It's partially inspired by `wraps` which in turn uses `partial`, but extended to be a descriptor so\n    these functions can be applied to instance methods, class methods, static methods, as well as normal functions.\n    \"\"\"\n\n    __slots__ = (\n        'raw_function',\n        '_config',\n        '_validate_return',\n        '__pydantic_core_schema__',\n        '__pydantic_validator__',\n        '__signature__',\n        '__name__',\n        '__qualname__',\n        '__annotations__',\n        '__dict__',  # required for __module__\n    )\n\n    def __init__(self, function: Callable[..., Any], config: ConfigDict | None, validate_return: bool):\n        self.raw_function = function\n        self._config = config\n        self._validate_return = validate_return\n        self.__signature__ = inspect.signature(function)\n        if isinstance(function, partial):\n            func = function.func\n            schema_type = func\n            self.__name__ = f'partial({func.__name__})'\n            self.__qualname__ = f'partial({func.__qualname__})'\n            self.__annotations__ = func.__annotations__\n            self.__module__ = func.__module__\n            self.__doc__ = func.__doc__\n        else:\n            schema_type = function\n            self.__name__ = function.__name__\n            self.__qualname__ = function.__qualname__\n            self.__annotations__ = function.__annotations__\n            self.__module__ = function.__module__\n            self.__doc__ = function.__doc__\n\n        namespace = _typing_extra.add_module_globals(function, None)\n        config_wrapper = ConfigWrapper(config)\n        gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n        schema = gen_schema.clean_schema(gen_schema.generate_schema(function))\n        self.__pydantic_core_schema__ = schema\n        core_config = config_wrapper.core_config(self)\n\n        self.__pydantic_validator__ = create_schema_validator(\n            schema,\n            schema_type,\n            self.__module__,\n            self.__qualname__,\n            'validate_call',\n            core_config,\n            config_wrapper.plugin_settings,\n        )\n\n        if self._validate_return:\n            return_type = (\n                self.__signature__.return_annotation\n                if self.__signature__.return_annotation is not self.__signature__.empty\n                else Any\n            )\n            gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n            schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type))\n            self.__return_pydantic_core_schema__ = schema\n            validator = create_schema_validator(\n                schema,\n                schema_type,\n                self.__module__,\n                self.__qualname__,\n                'validate_call',\n                core_config,\n                config_wrapper.plugin_settings,\n            )\n            if inspect.iscoroutinefunction(self.raw_function):\n\n                async def return_val_wrapper(aw: Awaitable[Any]) -> None:\n                    return validator.validate_python(await aw)\n\n                self.__return_pydantic_validator__ = return_val_wrapper\n            else:\n                self.__return_pydantic_validator__ = validator.validate_python\n        else:\n            self.__return_pydantic_core_schema__ = None\n            self.__return_pydantic_validator__ = None\n\n        self._name: str | None = None  # set by __get__, used to set the instance attribute when decorating methods\n\n    def __call__(self, *args: Any, **kwargs: Any) -> Any:\n        res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))\n        if self.__return_pydantic_validator__:\n            return self.__return_pydantic_validator__(res)\n        return res\n\n    def __get__(self, obj: Any, objtype: type[Any] | None = None) -> ValidateCallWrapper:\n        \"\"\"Bind the raw function and return another ValidateCallWrapper wrapping that.\"\"\"\n        if obj is None:\n            try:\n                # Handle the case where a method is accessed as a class attribute\n                return objtype.__getattribute__(objtype, self._name)  # type: ignore\n            except AttributeError:\n                # This will happen the first time the attribute is accessed\n                pass\n\n        bound_function = self.raw_function.__get__(obj, objtype)\n        result = self.__class__(bound_function, self._config, self._validate_return)\n\n        # skip binding to instance when obj or objtype has __slots__ attribute\n        if hasattr(obj, '__slots__') or hasattr(objtype, '__slots__'):\n            return result\n\n        if self._name is not None:\n            if obj is not None:\n                object.__setattr__(obj, self._name, result)\n            else:\n                object.__setattr__(objtype, self._name, result)\n        return result\n\n    def __set_name__(self, owner: Any, name: str) -> None:\n        self._name = name\n\n    def __repr__(self) -> str:\n        return f'ValidateCallWrapper({self.raw_function})'\n\n    def __eq__(self, other):\n        return self.raw_function == other.raw_function\n", "path": "pydantic/_internal/_validate_call.py"}], "after_files": [{"content": "from __future__ import annotations as _annotations\n\nimport inspect\nfrom dataclasses import dataclass\nfrom functools import partial\nfrom typing import Any, Awaitable, Callable\n\nimport pydantic_core\n\nfrom ..config import ConfigDict\nfrom ..plugin._schema_validator import create_schema_validator\nfrom . import _generate_schema, _typing_extra\nfrom ._config import ConfigWrapper\n\n\n@dataclass\nclass CallMarker:\n    function: Callable[..., Any]\n    validate_return: bool\n\n\nclass ValidateCallWrapper:\n    \"\"\"This is a wrapper around a function that validates the arguments passed to it, and optionally the return value.\n\n    It's partially inspired by `wraps` which in turn uses `partial`, but extended to be a descriptor so\n    these functions can be applied to instance methods, class methods, static methods, as well as normal functions.\n    \"\"\"\n\n    __slots__ = (\n        'raw_function',\n        '_config',\n        '_validate_return',\n        '__pydantic_core_schema__',\n        '__pydantic_validator__',\n        '__signature__',\n        '__name__',\n        '__qualname__',\n        '__annotations__',\n        '__dict__',  # required for __module__\n    )\n\n    def __init__(self, function: Callable[..., Any], config: ConfigDict | None, validate_return: bool):\n        self.raw_function = function\n        self._config = config\n        self._validate_return = validate_return\n        self.__signature__ = inspect.signature(function)\n        if isinstance(function, partial):\n            func = function.func\n            schema_type = func\n            self.__name__ = f'partial({func.__name__})'\n            self.__qualname__ = f'partial({func.__qualname__})'\n            self.__annotations__ = func.__annotations__\n            self.__module__ = func.__module__\n            self.__doc__ = func.__doc__\n        else:\n            schema_type = function\n            self.__name__ = function.__name__\n            self.__qualname__ = function.__qualname__\n            self.__annotations__ = function.__annotations__\n            self.__module__ = function.__module__\n            self.__doc__ = function.__doc__\n\n        namespace = _typing_extra.add_module_globals(function, None)\n        config_wrapper = ConfigWrapper(config)\n        gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n        schema = gen_schema.clean_schema(gen_schema.generate_schema(function))\n        self.__pydantic_core_schema__ = schema\n        core_config = config_wrapper.core_config(self)\n\n        self.__pydantic_validator__ = create_schema_validator(\n            schema,\n            schema_type,\n            self.__module__,\n            self.__qualname__,\n            'validate_call',\n            core_config,\n            config_wrapper.plugin_settings,\n        )\n\n        if self._validate_return:\n            return_type = (\n                self.__signature__.return_annotation\n                if self.__signature__.return_annotation is not self.__signature__.empty\n                else Any\n            )\n            gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)\n            schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type))\n            self.__return_pydantic_core_schema__ = schema\n            validator = create_schema_validator(\n                schema,\n                schema_type,\n                self.__module__,\n                self.__qualname__,\n                'validate_call',\n                core_config,\n                config_wrapper.plugin_settings,\n            )\n            if inspect.iscoroutinefunction(self.raw_function):\n\n                async def return_val_wrapper(aw: Awaitable[Any]) -> None:\n                    return validator.validate_python(await aw)\n\n                self.__return_pydantic_validator__ = return_val_wrapper\n            else:\n                self.__return_pydantic_validator__ = validator.validate_python\n        else:\n            self.__return_pydantic_core_schema__ = None\n            self.__return_pydantic_validator__ = None\n\n        self._name: str | None = None  # set by __get__, used to set the instance attribute when decorating methods\n\n    def __call__(self, *args: Any, **kwargs: Any) -> Any:\n        res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))\n        if self.__return_pydantic_validator__:\n            return self.__return_pydantic_validator__(res)\n        return res\n\n    def __get__(self, obj: Any, objtype: type[Any] | None = None) -> ValidateCallWrapper:\n        \"\"\"Bind the raw function and return another ValidateCallWrapper wrapping that.\"\"\"\n        if obj is None:\n            try:\n                # Handle the case where a method is accessed as a class attribute\n                return objtype.__getattribute__(objtype, self._name)  # type: ignore\n            except AttributeError:\n                # This will happen the first time the attribute is accessed\n                pass\n\n        bound_function = self.raw_function.__get__(obj, objtype)\n        result = self.__class__(bound_function, self._config, self._validate_return)\n\n        # skip binding to instance when obj or objtype has __slots__ attribute\n        if hasattr(obj, '__slots__') or hasattr(objtype, '__slots__'):\n            return result\n\n        if self._name is not None:\n            if obj is not None:\n                object.__setattr__(obj, self._name, result)\n            else:\n                object.__setattr__(objtype, self._name, result)\n        return result\n\n    def __set_name__(self, owner: Any, name: str) -> None:\n        self._name = name\n\n    def __repr__(self) -> str:\n        return f'ValidateCallWrapper({self.raw_function})'\n\n    def __eq__(self, other) -> bool:\n        return (\n            (self.raw_function == other.raw_function)\n            and (self._config == other._config)\n            and (self._validate_return == other._validate_return)\n        )\n\n    def __hash__(self):\n        return hash(self.raw_function)\n", "path": "pydantic/_internal/_validate_call.py"}]}