Skip to content

Commit a3c9392

Browse files
authored
Add overload to cast for objects (#4851)
Fixes #4810
1 parent 2cb6b14 commit a3c9392

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

stdlib/2/typing.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ def get_type_hints(
460460
def cast(tp: Type[_T], obj: Any) -> _T: ...
461461
@overload
462462
def cast(tp: str, obj: Any) -> Any: ...
463+
@overload
464+
def cast(tp: object, obj: Any) -> Any: ...
463465

464466
# Type constructors
465467

stdlib/3/typing.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,8 @@ if sys.version_info >= (3, 8):
633633
def cast(typ: Type[_T], val: Any) -> _T: ...
634634
@overload
635635
def cast(typ: str, val: Any) -> Any: ...
636+
@overload
637+
def cast(typ: object, val: Any) -> Any: ...
636638

637639
# Type constructors
638640

0 commit comments

Comments
 (0)