mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add stub for typing.ForwardRef (#3876)
* Add stub for class ForwardRef * Add anotation for localns * PEP8 and add version info check
This commit is contained in:
@@ -659,3 +659,18 @@ def NewType(name: str, tp: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
# This itself is only available during type checking
|
||||
def type_check_only(func_or_cls: _C) -> _C: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from types import CodeType
|
||||
class ForwardRef:
|
||||
__forward_arg__: str
|
||||
__forward_code__: CodeType
|
||||
__forward_evaluated__: bool
|
||||
__forward_value__: Optional[Any]
|
||||
__forward_is_argument__: bool
|
||||
def __init__(self, arg: str, is_argument: bool = ...) -> None: ...
|
||||
def _evaluate(self, globalns: Optional[Dict[str, Any]],
|
||||
localns: Optional[Dict[str, Any]]) -> Optional[Any]: ...
|
||||
def __eq__(self, other: Any) -> Union[bool, NotImplemented]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user