Repository: pydantic/pydantic

Issue:
AnyClassMethod type annotation
### Initial Checks

- [X] I have searched GitHub for a duplicate issue and I'm sure this is something new
- [X] I have searched Google & StackOverflow for a solution and couldn't find anything
- [X] I have read and followed [the docs](https://docs.pydantic.dev) and still think this is a bug
- [X] I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like [FastAPI](https://fastapi.tiangolo.com) or [mypy](https://mypy.readthedocs.io/en/stable))


### Description

Hello, current type annotation for AnyClassMethod is classmethod[Any] while the definition in typeshed has changed 
 as you can see in https://github.com/python/typeshed/blob/main/stdlib/builtins.pyi#L131
This change has been introduced in typeshed a couple of weeks ago https://github.com/python/typeshed/pull/9771/files

Would it be possible to fix the type annotations in pydantic accordingly ?

This impact pyright, as it starts reporting "partially unknown" types (which it is right about)

### Example Code

_No response_

### Python, Pydantic & OS Version

```Text
pydantic version: 1.10.2
            pydantic compiled: False
                 install path: /home/vscode/.local/lib/python3.11/site-packages/pydantic
               python version: 3.11.2 (main, Feb  9 2023, 20:14:21) [GCC 10.2.1 20210110]
                     platform: Linux-5.15.49-linuxkit-aarch64-with-glibc2.31
     optional deps. installed: ['dotenv', 'typing-extensions']
```


### Affected Components

- [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
- [ ] [Data validation/parsing](https://docs.pydantic.dev/usage/models/#basic-model-usage)
- [ ] [Data serialization](https://docs.pydantic.dev/usage/exporting_models/) - `.dict()` and `.json()`
- [ ] [JSON Schema](https://docs.pydantic.dev/usage/schema/)
- [ ] [Dataclasses](https://docs.pydantic.dev/usage/dataclasses/)
- [ ] [Model Config](https://docs.pydantic.dev/usage/model_config/)
- [ ] [Field Types](https://docs.pydantic.dev/usage/types/) - adding or changing a particular data type
- [ ] [Function validation decorator](https://docs.pydantic.dev/usage/validation_decorator/)
- [ ] [Generic Models](https://docs.pydantic.dev/usage/models/#generic-models)
- [ ] [Other Model behaviour](https://docs.pydantic.dev/usage/models/) - `construct()`, pickling, private attributes, ORM mode
- [x] [Plugins](https://docs.pydantic.dev/) and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.


Discussion:
Still relevant for `pydantic==1.10.7`. We are unable to use the last few releases of pyright until this is resolved.

Resolving patch:
diff --git a/pydantic/typing.py b/pydantic/typing.py
--- a/pydantic/typing.py
+++ b/pydantic/typing.py
@@ -271,7 +271,13 @@ def is_union(tp: Optional[Type[Any]]) -> bool:
     MappingIntStrAny = Mapping[IntStr, Any]
     CallableGenerator = Generator[AnyCallable, None, None]
     ReprArgs = Sequence[Tuple[Optional[str], Any]]
-    AnyClassMethod = classmethod[Any]
+
+    MYPY = False
+    if MYPY:
+        AnyClassMethod = classmethod[Any]
+    else:
+        # classmethod[TargetType, CallableParamSpecType, CallableReturnType]
+        AnyClassMethod = classmethod[Any, Any, Any]
 
 __all__ = (
     'AnyCallable',


Test patch: