Skip to content

Commit b47628d

Browse files
authored
🚨 make linter happy
1 parent 4fc029f commit b47628d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

githubkit/compat.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Generator
2-
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar
2+
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar, overload
33

44
from pydantic import VERSION
55

@@ -36,9 +36,21 @@ class GitHubModel(BaseModel):
3636
class ExtraGitHubModel(GitHubModel):
3737
model_config = ConfigDict(extra="allow")
3838

39+
@overload
40+
def type_validate_python(type_: type[T], data: Any) -> T: ...
41+
42+
@overload
43+
def type_validate_python(type_: Any, data: Any) -> Any: ...
44+
3945
def type_validate_python(type_: type[T], data: Any) -> T:
4046
return TypeAdapter(type_).validate_python(data)
4147

48+
@overload
49+
def type_validate_json(type_: type[T], data: Any) -> T: ...
50+
51+
@overload
52+
def type_validate_json(type_: Any, data: Any) -> Any: ...
53+
4254
def type_validate_json(type_: type[T], data: Any) -> T:
4355
return TypeAdapter(type_).validate_json(data)
4456

0 commit comments

Comments
 (0)