mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
Various packages stubtest fixes (#5221)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user