Add overload to cast for objects (#4851)

Fixes #4810
This commit is contained in:
Nils K authored and GitHub committed 2020-12-27 23:46:26 -08:00
1 parent 2cb6b14834
commit a3c9392331
2 files changed
+4

No files matched your search

+2
View File
@@ -460,6 +460,8 @@ def get_type_hints(
def cast(tp: Type[_T], obj: Any) -> _T: ...
@overload
def cast(tp: str, obj: Any) -> Any: ...
@overload
def cast(tp: object, obj: Any) -> Any: ...
# Type constructors