mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Accept str in cast (#2408)
This commit is contained in:
committed by
Jelle Zijlstra
parent
9e023e7586
commit
fe04d3aa2d
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user