Accept str in cast (#2408)

This commit is contained in:
Ilya Konstantinov
2018-08-21 07:53:35 -07:00
committed by Jelle Zijlstra
parent 9e023e7586
commit fe04d3aa2d
2 changed files with 6 additions and 0 deletions

View File

@@ -416,7 +416,10 @@ class Pattern(Generic[AnyStr]):
def get_type_hints(obj: Callable, globalns: Optional[dict[Text, Any]] = ...,
localns: Optional[dict[Text, Any]] = ...) -> None: ...
@overload
def cast(tp: Type[_T], obj: Any) -> _T: ...
@overload
def cast(tp: str, obj: Any) -> Any: ...
# Type constructors

View File

@@ -535,7 +535,10 @@ class Pattern(Generic[AnyStr]):
def get_type_hints(obj: Callable, globalns: Optional[dict[str, Any]] = ...,
localns: Optional[dict[str, Any]] = ...) -> dict[str, Any]: ...
@overload
def cast(tp: Type[_T], obj: Any) -> _T: ...
@overload
def cast(tp: str, obj: Any) -> Any: ...
# Type constructors