Skip to content

Commit

Permalink
update AnyClassMethod for change in python/typeshed#9771 (#5505)
Browse files Browse the repository at this point in the history
* update `AnyClassMethod` for change in python/typeshed#9771

* update mypy to use recent version of typeshed

* Add comment to try to trigger CI

* revert mypy version, add condition around AnyClassMethod

---------

Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
  • Loading branch information
ITProKyle and adriangb committed Apr 24, 2023
1 parent c1b11d1 commit 5cfedf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/5505-ITProKyle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update `AnyClassMethod` for changes in [python/typeshed#9771](https://github.com/python/typeshed/issues/9771)
8 changes: 7 additions & 1 deletion pydantic/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5cfedf2

Please sign in to comment.