mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Fix annotations with literal values (#3411)
This commit is contained in:
committed by
Jelle Zijlstra
parent
6a7c2011cc
commit
87d7dd3d95
@@ -4,17 +4,17 @@
|
||||
|
||||
from typing import Mapping, Any, Tuple
|
||||
|
||||
CREATE_NEW_CONSOLE = 0
|
||||
CREATE_NEW_PROCESS_GROUP = 0
|
||||
STD_INPUT_HANDLE = 0
|
||||
STD_OUTPUT_HANDLE = 0
|
||||
STD_ERROR_HANDLE = 0
|
||||
SW_HIDE = 0
|
||||
STARTF_USESTDHANDLES = 0
|
||||
STARTF_USESHOWWINDOW = 0
|
||||
INFINITE = 0
|
||||
DUPLICATE_SAME_ACCESS = 0
|
||||
WAIT_OBJECT_0 = 0
|
||||
CREATE_NEW_CONSOLE: int
|
||||
CREATE_NEW_PROCESS_GROUP: int
|
||||
STD_INPUT_HANDLE: int
|
||||
STD_OUTPUT_HANDLE: int
|
||||
STD_ERROR_HANDLE: int
|
||||
SW_HIDE: int
|
||||
STARTF_USESTDHANDLES: int
|
||||
STARTF_USESHOWWINDOW: int
|
||||
INFINITE: int
|
||||
DUPLICATE_SAME_ACCESS: int
|
||||
WAIT_OBJECT_0: int
|
||||
|
||||
# TODO not exported by the Python module
|
||||
class Handle:
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
from typing import Tuple, Callable, Optional
|
||||
from types import TracebackType
|
||||
|
||||
BUFSIZE: int = ...
|
||||
PIPE: int = ...
|
||||
STDOUT: int = ...
|
||||
BUFSIZE: int
|
||||
PIPE: int
|
||||
STDOUT: int
|
||||
|
||||
def pipe(*, duplex: bool = ..., overlapped: Tuple[bool, bool] = ..., bufsize: int = ...) -> Tuple[int, int]: ...
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@ def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Op
|
||||
# undocumented
|
||||
def _main(fd: int) -> Any: ...
|
||||
def get_preparation_data(name: str) -> Dict[str, Any]: ...
|
||||
old_main_modules: List[ModuleType] = ...
|
||||
old_main_modules: List[ModuleType]
|
||||
def prepare(data: Mapping[str, Any]) -> None: ...
|
||||
def import_main_path(main_path: str) -> None: ...
|
||||
|
||||
@@ -19,8 +19,8 @@ class shlex(Iterable[str]):
|
||||
infile: str
|
||||
instream: TextIO
|
||||
source: str
|
||||
debug = 0
|
||||
lineno = 0
|
||||
debug: int
|
||||
lineno: int
|
||||
token: str
|
||||
eof: str
|
||||
if sys.version_info >= (3, 6):
|
||||
|
||||
@@ -814,7 +814,7 @@ class TimeoutExpired(SubprocessError):
|
||||
|
||||
|
||||
class CalledProcessError(Exception):
|
||||
returncode = 0
|
||||
returncode: int
|
||||
# morally: _CMD
|
||||
cmd: Any
|
||||
# morally: Optional[_TXT]
|
||||
@@ -835,8 +835,8 @@ class Popen(Generic[AnyStr]):
|
||||
stdin: IO[AnyStr]
|
||||
stdout: IO[AnyStr]
|
||||
stderr: IO[AnyStr]
|
||||
pid = 0
|
||||
returncode = 0
|
||||
pid: int
|
||||
returncode: int
|
||||
|
||||
# Technically it is wrong that Popen provides __new__ instead of __init__
|
||||
# but this shouldn't come up hopefully?
|
||||
|
||||
@@ -29,7 +29,7 @@ if sys.version_info >= (3, 8):
|
||||
def final(f: _F) -> _F: ...
|
||||
Literal: _SpecialForm = ...
|
||||
# TypedDict is a (non-subscriptable) special form.
|
||||
TypedDict: object = ...
|
||||
TypedDict: object
|
||||
|
||||
class GenericMeta(type): ...
|
||||
|
||||
@@ -525,8 +525,8 @@ class TextIO(IO[str]):
|
||||
class ByteString(Sequence[int], metaclass=ABCMeta): ...
|
||||
|
||||
class Match(Generic[AnyStr]):
|
||||
pos = 0
|
||||
endpos = 0
|
||||
pos: int
|
||||
endpos: int
|
||||
lastindex: Optional[int]
|
||||
lastgroup: Optional[AnyStr]
|
||||
string: AnyStr
|
||||
@@ -559,9 +559,9 @@ class Match(Generic[AnyStr]):
|
||||
def __getitem__(self, g: Union[int, str]) -> AnyStr: ...
|
||||
|
||||
class Pattern(Generic[AnyStr]):
|
||||
flags = 0
|
||||
flags: int
|
||||
groupindex: Mapping[str, int]
|
||||
groups = 0
|
||||
groups: int
|
||||
pattern: AnyStr
|
||||
|
||||
def search(self, string: AnyStr, pos: int = ...,
|
||||
|
||||
@@ -11,7 +11,7 @@ non_hierarchical: List[str]
|
||||
uses_query: List[str]
|
||||
uses_fragment: List[str]
|
||||
scheme_chars: str
|
||||
MAX_CACHE_SIZE = 0
|
||||
MAX_CACHE_SIZE: int
|
||||
|
||||
class _ResultMixinBase(Generic[AnyStr]):
|
||||
def geturl(self) -> AnyStr: ...
|
||||
|
||||
Reference in New Issue
Block a user