Various packages stubtest fixes (#5221)

This commit is contained in:
hatal175
2021-04-16 07:04:40 +03:00
committed by GitHub
parent 3d8bffae80
commit 82be016aa4
5 changed files with 20 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ import sys
from typing import List
class _Feature:
def __init__(self, optionalRelease: sys._version_info, mandatoryRelease: sys._version_info, compiler_flag: int) -> None: ...
def getOptionalRelease(self) -> sys._version_info: ...
def getMandatoryRelease(self) -> sys._version_info: ...
compiler_flag: int

View File

@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Iterator, MutableMapping, Optional, Type, Union
from typing import Iterator, MutableMapping, Optional, Tuple, Type, Union
from typing_extensions import Literal
_KeyType = Union[str, bytes]
@@ -18,7 +18,9 @@ class _Database(MutableMapping[_KeyType, bytes]):
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...
class error(Exception): ...
class _error(Exception): ...
error = Tuple[Type[_error], Type[OSError]]
def whichdb(filename: str) -> str: ...
def open(file: str, flag: Literal["r", "w", "c", "n"] = ..., mode: int = ...) -> _Database: ...

View File

@@ -1,15 +1,21 @@
import codecs
from typing import Tuple
from typing import Optional, Tuple
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = ...) -> bytes: ...
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[str, int]: ...
@staticmethod
def _buffer_decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...
class StreamWriter(codecs.StreamWriter): ...
class StreamReader(codecs.StreamReader): ...
class StreamWriter(codecs.StreamWriter):
@staticmethod
def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...
class StreamReader(codecs.StreamReader):
@staticmethod
def decode(__data: bytes, __errors: Optional[str] = ..., __final: bool = ...) -> Tuple[str, int]: ...
def getregentry() -> codecs.CodecInfo: ...
def encode(input: str, errors: str = ...) -> bytes: ...
def decode(input: bytes, errors: str = ...) -> str: ...
def encode(__str: str, __errors: Optional[str] = ...) -> Tuple[bytes, int]: ...
def decode(input: bytes, errors: Optional[str] = ...) -> Tuple[str, int]: ...

View File

@@ -4,5 +4,6 @@ def gnu_getopt(args: list[str], shortopts: str, longopts: list[str] = ...) -> tu
class GetoptError(Exception):
msg: str
opt: str
def __init__(self, msg: str, opt: str = ...) -> None: ...
error = GetoptError

View File

@@ -1,4 +1,3 @@
__future__._Feature.__init__
_collections_abc.Callable
_collections_abc.Coroutine.cr_await
_collections_abc.Coroutine.cr_code
@@ -21,7 +20,7 @@ _collections_abc.MutableSet.remove
_collections_abc.Sequence.count
_collections_abc.Sequence.index
_collections_abc.Set.isdisjoint
_csv.Dialect.__init__
_csv.Dialect.__init__ # C __init__ signature is inaccurate
_dummy_threading
_importlib_modulespec
_threading_local.local.__new__
@@ -131,22 +130,16 @@ ctypes.memset # CFunctionType
ctypes.pointer # imported C function
ctypes.string_at # docstring argument name is wrong
ctypes.wstring_at # docstring argument name is wrong
dbm.error
difflib.SequenceMatcher.__init__ # mypy default value for generic parameter issues. See https://github.com/python/mypy/issues/3737
distutils.command.bdist_packager # It exists in docs as package name but not in code except as a mention in a comment.
distutils.version.Version._cmp # class should have declared this
distutils.version.Version.parse # class should have declared this
email.headerregistry.BaseHeader.max_count # docs say subclasses should have this property
encodings.utf_8.IncrementalDecoder._buffer_decode
encodings.utf_8.StreamReader.decode
encodings.utf_8.StreamWriter.encode
encodings.utf_8.encode
enum.EnumMeta.__call__
enum.EnumMeta.__new__
getopt.GetoptError.__init__
http.HTTPStatus.description # set in __new__
http.HTTPStatus.phrase # set in __new__
imaplib.IMAP4_SSL.ssl
imaplib.IMAP4_SSL.ssl # Dependent on SSL existence
importlib.abc.FileLoader.get_filename # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.FileLoader.load_module # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatability