drop ellipsis assignments from module vars, classvars and instance attrs (#5914)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-11 19:26:58 +02:00
committed by GitHub
parent 6c41e3cead
commit 64f481189f
34 changed files with 325 additions and 325 deletions

View File

@@ -128,7 +128,7 @@ def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> T
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> Tuple[Any, int]: ...
class Overlapped:
event: int = ...
event: int
def GetOverlappedResult(self, __wait: bool) -> Tuple[int, int]: ...
def cancel(self) -> None: ...
def getbuffer(self) -> bytes | None: ...

View File

@@ -9,6 +9,6 @@ if sys.version_info >= (3, 7):
SENDFILE_FALLBACK_READBUFFER_SIZE: int
class _SendfileMode(enum.Enum):
UNSUPPORTED: int = ...
TRY_NATIVE: int = ...
FALLBACK: int = ...
UNSUPPORTED: int
TRY_NATIVE: int
FALLBACK: int

View File

@@ -66,7 +66,7 @@ class AbstractServer:
async def wait_closed(self) -> None: ...
class AbstractEventLoop(metaclass=ABCMeta):
slow_callback_duration: float = ...
slow_callback_duration: float
@abstractmethod
def run_forever(self) -> None: ...
# Can't use a union, see mypy issue # 1873.

View File

@@ -65,7 +65,7 @@ class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWrit
class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport):
_sendfile_compatible: constants._SendfileMode = ...
_sendfile_compatible: constants._SendfileMode
def __init__(
self,
loop: events.AbstractEventLoop,

View File

@@ -7,7 +7,7 @@ from typing import Any, Dict, Tuple, overload
_maptype = Dict[int, Any]
_socket = socket
socket_map: _maptype = ... # undocumented
socket_map: _maptype # undocumented
class ExitNow(Exception): ...

View File

@@ -5,7 +5,7 @@ _T = TypeVar("_T")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType]
GENERATOR_AND_COROUTINE_FLAGS: int = ...
GENERATOR_AND_COROUTINE_FLAGS: int
class BdbQuit(Exception): ...
@@ -65,9 +65,9 @@ class Bdb:
class Breakpoint:
next: int = ...
bplist: dict[Tuple[str, int], list[Breakpoint]] = ...
bpbynumber: list[Breakpoint | None] = ...
next: int
bplist: dict[Tuple[str, int], list[Breakpoint]]
bpbynumber: list[Breakpoint | None]
funcname: str | None
func_first_executable_line: int | None

View File

@@ -48,16 +48,16 @@ class LegacyInterpolation(Interpolation):
def before_get(self, parser: _parser, section: str, option: str, value: str, vars: _section) -> str: ...
class RawConfigParser(_parser):
_SECT_TMPL: ClassVar[str] = ... # undocumented
_OPT_TMPL: ClassVar[str] = ... # undocumented
_OPT_NV_TMPL: ClassVar[str] = ... # undocumented
_SECT_TMPL: ClassVar[str] # undocumented
_OPT_TMPL: ClassVar[str] # undocumented
_OPT_NV_TMPL: ClassVar[str] # undocumented
SECTCRE: Pattern[str] = ...
OPTCRE: ClassVar[Pattern[str]] = ...
OPTCRE_NV: ClassVar[Pattern[str]] = ... # undocumented
NONSPACECRE: ClassVar[Pattern[str]] = ... # undocumented
SECTCRE: Pattern[str]
OPTCRE: ClassVar[Pattern[str]]
OPTCRE_NV: ClassVar[Pattern[str]] # undocumented
NONSPACECRE: ClassVar[Pattern[str]] # undocumented
BOOLEAN_STATES: ClassVar[Mapping[str, bool]] = ... # undocumented
BOOLEAN_STATES: ClassVar[Mapping[str, bool]] # undocumented
default_section: str
@overload
def __init__(

View File

@@ -24,16 +24,16 @@ _T = TypeVar("_T")
_DLLT = TypeVar("_DLLT", bound=CDLL)
_CT = TypeVar("_CT", bound=_CData)
RTLD_GLOBAL: int = ...
RTLD_LOCAL: int = ...
DEFAULT_MODE: int = ...
RTLD_GLOBAL: int
RTLD_LOCAL: int
DEFAULT_MODE: int
class CDLL(object):
_func_flags_: ClassVar[int] = ...
_func_restype_: ClassVar[_CData] = ...
_name: str = ...
_handle: int = ...
_FuncPtr: Type[_FuncPointer] = ...
_func_flags_: ClassVar[int]
_func_restype_: ClassVar[_CData]
_name: str
_handle: int
_FuncPtr: Type[_FuncPointer]
if sys.version_info >= (3, 8):
def __init__(
self,
@@ -65,12 +65,12 @@ class LibraryLoader(Generic[_DLLT]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
cdll: LibraryLoader[CDLL] = ...
cdll: LibraryLoader[CDLL]
if sys.platform == "win32":
windll: LibraryLoader[WinDLL] = ...
oledll: LibraryLoader[OleDLL] = ...
pydll: LibraryLoader[PyDLL] = ...
pythonapi: PyDLL = ...
windll: LibraryLoader[WinDLL]
oledll: LibraryLoader[OleDLL]
pydll: LibraryLoader[PyDLL]
pythonapi: PyDLL
# Anything that implements the read-write buffer interface.
# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol
@@ -87,9 +87,9 @@ class _CDataMeta(type):
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
class _CData(metaclass=_CDataMeta):
_b_base: int = ...
_b_needsfree_: bool = ...
_objects: Mapping[Any, int] | None = ...
_b_base: int
_b_needsfree_: bool
_objects: Mapping[Any, int] | None
@classmethod
def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ...
@classmethod
@@ -108,9 +108,9 @@ _ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CDa
_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]]
class _FuncPointer(_PointerLike, _CData):
restype: Type[_CData] | Callable[[int], Any] | None = ...
argtypes: Sequence[Type[_CData]] = ...
errcheck: _ECT = ...
restype: Type[_CData] | Callable[[int], Any] | None
argtypes: Sequence[Type[_CData]]
errcheck: _ECT
@overload
def __init__(self, address: int) -> None: ...
@overload
@@ -180,8 +180,8 @@ def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ...
# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer,
# it can be instantiated directly (to mimic the behavior of the real pointer function).
class pointer(Generic[_CT], _PointerLike, _CData):
_type_: ClassVar[Type[_CT]] = ...
contents: _CT = ...
_type_: ClassVar[Type[_CT]]
contents: _CT
def __init__(self, arg: _CT = ...) -> None: ...
@overload
def __getitem__(self, i: int) -> _CT: ...
@@ -207,7 +207,7 @@ if sys.platform == "win32":
def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ...
class _SimpleCData(Generic[_T], _CData):
value: _T = ...
value: _T
def __init__(self, value: _T = ...) -> None: ...
class c_byte(_SimpleCData[int]): ...
@@ -255,13 +255,13 @@ if sys.platform == "win32":
class py_object(_CanCastTo, _SimpleCData[_T]): ...
class _CField:
offset: int = ...
size: int = ...
offset: int
size: int
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[Tuple[str, Type[_CData]] | Tuple[str, Type[_CData], int]] = ...
_pack_: int = ...
_anonymous_: Sequence[str] = ...
_fields_: Sequence[Tuple[str, Type[_CData]] | Tuple[str, Type[_CData], int]]
_pack_: int
_anonymous_: Sequence[str]
def __getattr__(self, name: str) -> _CField: ...
class _StructUnionBase(_CData, metaclass=_StructUnionMeta):
@@ -275,10 +275,10 @@ class BigEndianStructure(Structure): ...
class LittleEndianStructure(Structure): ...
class Array(Generic[_CT], _CData):
_length_: ClassVar[int] = ...
_type_: ClassVar[Type[_CT]] = ...
raw: bytes = ... # Note: only available if _CT == c_char
value: Any = ... # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
_length_: ClassVar[int]
_type_: ClassVar[Type[_CT]]
raw: bytes # Note: only available if _CT == c_char
value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
# TODO These methods cannot be annotated correctly at the moment.
# All of these "Any"s stand for the array's element type, but it's not possible to use _CT
# here, because of a special feature of ctypes.

View File

@@ -8,7 +8,7 @@ _ValueType = Union[str, bytes]
class error(OSError): ...
library: str = ...
library: str
# Actual typename dbm, not exposed by the implementation
class _dbm:

View File

@@ -186,7 +186,7 @@ class Context(object):
def clear_traps(self) -> None: ...
def copy(self) -> Context: ...
def __copy__(self) -> Context: ...
__hash__: Any = ...
__hash__: Any
def Etiny(self) -> int: ...
def Etop(self) -> int: ...
def create_decimal(self, __num: _DecimalNew = ...) -> Decimal: ...

View File

@@ -3,8 +3,8 @@ from typing_extensions import Literal
# class is entirely undocumented
class FileList:
allfiles: Iterable[str] | None = ...
files: list[str] = ...
allfiles: Iterable[str] | None
files: list[str]
def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...

View File

@@ -6,17 +6,17 @@ from typing_extensions import Final
_T = TypeVar("_T")
WSP: Final[Set[str]] = ...
CFWS_LEADER: Final[Set[str]] = ...
SPECIALS: Final[Set[str]] = ...
ATOM_ENDS: Final[Set[str]] = ...
DOT_ATOM_ENDS: Final[Set[str]] = ...
PHRASE_ENDS: Final[Set[str]] = ...
TSPECIALS: Final[Set[str]] = ...
TOKEN_ENDS: Final[Set[str]] = ...
ASPECIALS: Final[Set[str]] = ...
ATTRIBUTE_ENDS: Final[Set[str]] = ...
EXTENDED_ATTRIBUTE_ENDS: Final[Set[str]] = ...
WSP: Final[Set[str]]
CFWS_LEADER: Final[Set[str]]
SPECIALS: Final[Set[str]]
ATOM_ENDS: Final[Set[str]]
DOT_ATOM_ENDS: Final[Set[str]]
PHRASE_ENDS: Final[Set[str]]
TSPECIALS: Final[Set[str]]
TOKEN_ENDS: Final[Set[str]]
ASPECIALS: Final[Set[str]]
ATTRIBUTE_ENDS: Final[Set[str]]
EXTENDED_ATTRIBUTE_ENDS: Final[Set[str]]
def quote_string(value: Any) -> str: ...
@@ -24,10 +24,10 @@ if sys.version_info >= (3, 7):
rfc2047_matcher: Pattern[str]
class TokenList(List[Union[TokenList, Terminal]]):
token_type: str | None = ...
syntactic_break: bool = ...
ew_combine_allowed: bool = ...
defects: list[MessageDefect] = ...
token_type: str | None
syntactic_break: bool
ew_combine_allowed: bool
defects: list[MessageDefect]
def __init__(self, *args: Any, **kw: Any) -> None: ...
@property
def value(self) -> str: ...
@@ -49,32 +49,32 @@ class WhiteSpaceTokenList(TokenList):
def comments(self) -> list[str]: ...
class UnstructuredTokenList(TokenList):
token_type: str = ...
token_type: str
class Phrase(TokenList):
token_type: str = ...
token_type: str
class Word(TokenList):
token_type: str = ...
token_type: str
class CFWSList(WhiteSpaceTokenList):
token_type: str = ...
token_type: str
class Atom(TokenList):
token_type: str = ...
token_type: str
class Token(TokenList):
token_type: str = ...
encode_as_ew: bool = ...
token_type: str
encode_as_ew: bool
class EncodedWord(TokenList):
token_type: str = ...
cte: str | None = ...
charset: str | None = ...
lang: str | None = ...
token_type: str
cte: str | None
charset: str | None
lang: str | None
class QuotedString(TokenList):
token_type: str = ...
token_type: str
@property
def content(self) -> str: ...
@property
@@ -83,12 +83,12 @@ class QuotedString(TokenList):
def stripped_value(self) -> str: ...
class BareQuotedString(QuotedString):
token_type: str = ...
token_type: str
@property
def value(self) -> str: ...
class Comment(WhiteSpaceTokenList):
token_type: str = ...
token_type: str
def quote(self, value: Any) -> str: ...
@property
def content(self) -> str: ...
@@ -96,7 +96,7 @@ class Comment(WhiteSpaceTokenList):
def comments(self) -> list[str]: ...
class AddressList(TokenList):
token_type: str = ...
token_type: str
@property
def addresses(self) -> list[Address]: ...
@property
@@ -105,7 +105,7 @@ class AddressList(TokenList):
def all_mailboxes(self) -> list[Mailbox]: ...
class Address(TokenList):
token_type: str = ...
token_type: str
@property
def display_name(self) -> str: ...
@property
@@ -114,21 +114,21 @@ class Address(TokenList):
def all_mailboxes(self) -> list[Mailbox]: ...
class MailboxList(TokenList):
token_type: str = ...
token_type: str
@property
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> list[Mailbox]: ...
class GroupList(TokenList):
token_type: str = ...
token_type: str
@property
def mailboxes(self) -> list[Mailbox]: ...
@property
def all_mailboxes(self) -> list[Mailbox]: ...
class Group(TokenList):
token_type: str = ...
token_type: str
@property
def mailboxes(self) -> list[Mailbox]: ...
@property
@@ -137,7 +137,7 @@ class Group(TokenList):
def display_name(self) -> str: ...
class NameAddr(TokenList):
token_type: str = ...
token_type: str
@property
def display_name(self) -> str: ...
@property
@@ -150,7 +150,7 @@ class NameAddr(TokenList):
def addr_spec(self) -> str: ...
class AngleAddr(TokenList):
token_type: str = ...
token_type: str
@property
def local_part(self) -> str: ...
@property
@@ -161,12 +161,12 @@ class AngleAddr(TokenList):
def addr_spec(self) -> str: ...
class ObsRoute(TokenList):
token_type: str = ...
token_type: str
@property
def domains(self) -> list[Domain]: ...
class Mailbox(TokenList):
token_type: str = ...
token_type: str
@property
def display_name(self) -> str: ...
@property
@@ -179,35 +179,35 @@ class Mailbox(TokenList):
def addr_spec(self) -> str: ...
class InvalidMailbox(TokenList):
token_type: str = ...
token_type: str
@property
def display_name(self) -> None: ...
local_part: None = ...
domain: None = ...
route: None = ...
addr_spec: None = ...
local_part: None
domain: None
route: None
addr_spec: None
class Domain(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
@property
def domain(self) -> str: ...
class DotAtom(TokenList):
token_type: str = ...
token_type: str
class DotAtomText(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
if sys.version_info >= (3, 8):
class NoFoldLiteral(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
class AddrSpec(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
@property
def local_part(self) -> str: ...
@property
@@ -218,115 +218,115 @@ class AddrSpec(TokenList):
def addr_spec(self) -> str: ...
class ObsLocalPart(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
class DisplayName(Phrase):
token_type: str = ...
ew_combine_allowed: bool = ...
token_type: str
ew_combine_allowed: bool
@property
def display_name(self) -> str: ...
@property
def value(self) -> str: ...
class LocalPart(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
@property
def value(self) -> str: ...
@property
def local_part(self) -> str: ...
class DomainLiteral(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
@property
def domain(self) -> str: ...
@property
def ip(self) -> str: ...
class MIMEVersion(TokenList):
token_type: str = ...
major: int | None = ...
minor: int | None = ...
token_type: str
major: int | None
minor: int | None
class Parameter(TokenList):
token_type: str = ...
sectioned: bool = ...
extended: bool = ...
charset: str = ...
token_type: str
sectioned: bool
extended: bool
charset: str
@property
def section_number(self) -> int: ...
@property
def param_value(self) -> str: ...
class InvalidParameter(Parameter):
token_type: str = ...
token_type: str
class Attribute(TokenList):
token_type: str = ...
token_type: str
@property
def stripped_value(self) -> str: ...
class Section(TokenList):
token_type: str = ...
number: int | None = ...
token_type: str
number: int | None
class Value(TokenList):
token_type: str = ...
token_type: str
@property
def stripped_value(self) -> str: ...
class MimeParameters(TokenList):
token_type: str = ...
syntactic_break: bool = ...
token_type: str
syntactic_break: bool
@property
def params(self) -> Iterator[Tuple[str, str]]: ...
class ParameterizedHeaderValue(TokenList):
syntactic_break: bool = ...
syntactic_break: bool
@property
def params(self) -> Iterable[Tuple[str, str]]: ...
class ContentType(ParameterizedHeaderValue):
token_type: str = ...
as_ew_allowed: bool = ...
maintype: str = ...
subtype: str = ...
token_type: str
as_ew_allowed: bool
maintype: str
subtype: str
class ContentDisposition(ParameterizedHeaderValue):
token_type: str = ...
as_ew_allowed: bool = ...
content_disposition: Any = ...
token_type: str
as_ew_allowed: bool
content_disposition: Any
class ContentTransferEncoding(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
cte: str = ...
token_type: str
as_ew_allowed: bool
cte: str
class HeaderLabel(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
if sys.version_info >= (3, 8):
class MsgID(TokenList):
token_type: str = ...
as_ew_allowed: bool = ...
token_type: str
as_ew_allowed: bool
def fold(self, policy: Policy) -> str: ...
class MessageID(MsgID):
token_type: str = ...
token_type: str
class InvalidMessageID(MessageID):
token_type: str = ...
token_type: str
class Header(TokenList):
token_type: str = ...
token_type: str
class Terminal(str):
as_ew_allowed: bool = ...
ew_combine_allowed: bool = ...
syntactic_break: bool = ...
token_type: str = ...
defects: list[MessageDefect] = ...
as_ew_allowed: bool
ew_combine_allowed: bool
syntactic_break: bool
token_type: str
defects: list[MessageDefect]
def __new__(cls: Type[_T], value: str, token_type: str) -> _T: ...
def pprint(self) -> None: ...
@property

View File

@@ -127,10 +127,10 @@ class _HTTPConnectionProtocol(Protocol):
) -> HTTPConnection: ...
class HTTPConnection:
auto_open: int = ... # undocumented
debuglevel: int = ...
default_port: int = ... # undocumented
response_class: Type[HTTPResponse] = ... # undocumented
auto_open: int # undocumented
debuglevel: int
default_port: int # undocumented
response_class: Type[HTTPResponse] # undocumented
timeout: float | None
host: str
port: int

View File

@@ -9,12 +9,12 @@ _T = TypeVar("_T")
class LoadError(OSError): ...
class CookieJar(Iterable[Cookie]):
non_word_re: ClassVar[Pattern[str]] = ... # undocumented
quote_re: ClassVar[Pattern[str]] = ... # undocumented
strict_domain_re: ClassVar[Pattern[str]] = ... # undocumented
domain_re: ClassVar[Pattern[str]] = ... # undocumented
dots_re: ClassVar[Pattern[str]] = ... # undocumented
magic_re: ClassVar[Pattern[str]] = ... # undocumented
non_word_re: ClassVar[Pattern[str]] # undocumented
quote_re: ClassVar[Pattern[str]] # undocumented
strict_domain_re: ClassVar[Pattern[str]] # undocumented
domain_re: ClassVar[Pattern[str]] # undocumented
dots_re: ClassVar[Pattern[str]] # undocumented
magic_re: ClassVar[Pattern[str]] # undocumented
def __init__(self, policy: CookiePolicy | None = ...) -> None: ...
def add_cookie_header(self, request: Request) -> None: ...
def extract_cookies(self, response: HTTPResponse, request: Request) -> None: ...
@@ -42,7 +42,7 @@ class FileCookieJar(CookieJar):
def revert(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ...
class MozillaCookieJar(FileCookieJar):
header: ClassVar[str] = ... # undocumented
header: ClassVar[str] # undocumented
class LWPCookieJar(FileCookieJar):
def as_lwp_str(self, ignore_discard: bool = ..., ignore_expires: bool = ...) -> str: ... # undocumented

View File

@@ -30,8 +30,8 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
MessageClass: type
responses: Mapping[int, Tuple[str, str]]
default_request_version: str # undocumented
weekdayname: ClassVar[Sequence[str]] = ... # undocumented
monthname: ClassVar[Sequence[str | None]] = ... # undocumented
weekdayname: ClassVar[Sequence[str]] # undocumented
monthname: ClassVar[Sequence[str | None]] # undocumented
def __init__(self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer) -> None: ...
def handle(self) -> None: ...
def handle_one_request(self) -> None: ...

View File

@@ -15,23 +15,23 @@ _CommandResults = Tuple[str, List[Any]]
_AnyResponseData = Union[List[None], List[Union[bytes, Tuple[bytes, bytes]]]]
class IMAP4:
error: Type[Exception] = ...
abort: Type[Exception] = ...
readonly: Type[Exception] = ...
mustquote: Pattern[str] = ...
debug: int = ...
state: str = ...
literal: str | None = ...
error: Type[Exception]
abort: Type[Exception]
readonly: Type[Exception]
mustquote: Pattern[str]
debug: int
state: str
literal: str | None
tagged_commands: dict[bytes, List[bytes] | None]
untagged_responses: dict[str, List[bytes | Tuple[bytes, bytes]]]
continuation_response: str = ...
is_readonly: bool = ...
tagnum: int = ...
tagpre: str = ...
tagre: Pattern[str] = ...
welcome: bytes = ...
capabilities: Tuple[str] = ...
PROTOCOL_VERSION: str = ...
continuation_response: str
is_readonly: bool
tagnum: int
tagpre: str
tagre: Pattern[str]
welcome: bytes
capabilities: Tuple[str]
PROTOCOL_VERSION: str
if sys.version_info >= (3, 9):
def __init__(self, host: str = ..., port: int = ..., timeout: float | None = ...) -> None: ...
def open(self, host: str = ..., port: int = ..., timeout: float | None = ...) -> None: ...
@@ -39,10 +39,10 @@ class IMAP4:
def __init__(self, host: str = ..., port: int = ...) -> None: ...
def open(self, host: str = ..., port: int = ...) -> None: ...
def __getattr__(self, attr: str) -> Any: ...
host: str = ...
port: int = ...
sock: _socket = ...
file: IO[str] | IO[bytes] = ...
host: str
port: int
sock: _socket
file: IO[str] | IO[bytes]
def read(self, size: int) -> bytes: ...
def readline(self) -> bytes: ...
def send(self, data: bytes) -> None: ...
@@ -98,8 +98,8 @@ class IMAP4:
def print_log(self) -> None: ...
class IMAP4_SSL(IMAP4):
keyfile: str = ...
certfile: str = ...
keyfile: str
certfile: str
if sys.version_info >= (3, 9):
def __init__(
self,
@@ -119,11 +119,11 @@ class IMAP4_SSL(IMAP4):
certfile: str | None = ...,
ssl_context: SSLContext | None = ...,
) -> None: ...
host: str = ...
port: int = ...
sock: _socket = ...
sslobj: SSLSocket = ...
file: IO[Any] = ...
host: str
port: int
sock: _socket
sslobj: SSLSocket
file: IO[Any]
if sys.version_info >= (3, 9):
def open(self, host: str = ..., port: int | None = ..., timeout: float | None = ...) -> None: ...
else:
@@ -136,15 +136,15 @@ class IMAP4_SSL(IMAP4):
def ssl(self) -> SSLSocket: ...
class IMAP4_stream(IMAP4):
command: str = ...
command: str
def __init__(self, command: str) -> None: ...
host: str = ...
port: int = ...
sock: _socket = ...
file: IO[Any] = ...
process: subprocess.Popen[bytes] = ...
writefile: IO[Any] = ...
readfile: IO[Any] = ...
host: str
port: int
sock: _socket
file: IO[Any]
process: subprocess.Popen[bytes]
writefile: IO[Any]
readfile: IO[Any]
if sys.version_info >= (3, 9):
def open(self, host: str | None = ..., port: int | None = ..., timeout: float | None = ...) -> None: ...
else:
@@ -155,7 +155,7 @@ class IMAP4_stream(IMAP4):
def shutdown(self) -> None: ...
class _Authenticator:
mech: Callable[[bytes], bytes] = ...
mech: Callable[[bytes], bytes]
def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ...
def process(self, data: str) -> str: ...
def encode(self, inp: bytes) -> str: ...

View File

@@ -119,7 +119,7 @@ else:
class Signature:
def __init__(self, parameters: Sequence[Parameter] | None = ..., *, return_annotation: Any = ...) -> None: ...
# TODO: can we be more specific here?
empty: object = ...
empty: object
parameters: Mapping[str, Parameter]
@@ -165,7 +165,7 @@ class _ParameterKind(enum.IntEnum):
class Parameter:
def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ...
empty: Any = ...
empty: Any
name: str
default: Any
annotation: Any

View File

@@ -12,7 +12,7 @@ class JSONDecoder:
object_hook: Callable[[dict[str, Any]], Any]
parse_float: Callable[[str], Any]
parse_int: Callable[[str], Any]
parse_constant: Callable[[str], Any] = ...
parse_constant: Callable[[str], Any]
strict: bool
object_pairs_hook: Callable[[list[Tuple[str, Any]]], Any]
def __init__(

View File

@@ -73,8 +73,8 @@ class _AcquireFunc(Protocol):
def __call__(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
class SynchronizedBase(Generic[_CT]):
acquire: _AcquireFunc = ...
release: Callable[[], None] = ...
acquire: _AcquireFunc
release: Callable[[], None]
def __init__(self, obj: Any, lock: _LockLike | None = ..., ctx: Any | None = ...) -> None: ...
def __reduce__(self) -> tuple[Callable[..., Any], tuple[Any, _LockLike]]: ...
def get_obj(self) -> _CT: ...

View File

@@ -350,7 +350,7 @@ if sys.platform != "win32":
f_favail: int
f_flag: int
f_namemax: int
f_fsid: int = ...
f_fsid: int
else:
class statvfs_result(_Tuple10Int): # Unix only
n_fields: int

View File

@@ -11,9 +11,9 @@ class PyCompileError(Exception):
if sys.version_info >= (3, 7):
import enum
class PycInvalidationMode(enum.Enum):
TIMESTAMP: int = ...
CHECKED_HASH: int = ...
UNCHECKED_HASH: int = ...
TIMESTAMP: int
CHECKED_HASH: int
UNCHECKED_HASH: int
def _get_default_invalidation_mode() -> PycInvalidationMode: ...
if sys.version_info >= (3, 8):

View File

@@ -3,14 +3,14 @@ from types import ModuleType
from typing import Any
class _TempModule:
mod_name: str = ...
module: ModuleType = ...
mod_name: str
module: ModuleType
def __init__(self, mod_name: str) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
class _ModifiedArgv0:
value: Any = ...
value: Any
def __init__(self, value: Any) -> None: ...
def __enter__(self) -> None: ...
def __exit__(self, *args: Any) -> None: ...

View File

@@ -54,15 +54,15 @@ class _AuthObject(Protocol):
def __call__(self, challenge: bytes) -> str: ...
class SMTP:
debuglevel: int = ...
sock: socket | None = ...
debuglevel: int
sock: socket | None
# Type of file should match what socket.makefile() returns
file: Any | None = ...
helo_resp: bytes | None = ...
ehlo_msg: str = ...
ehlo_resp: bytes | None = ...
does_esmtp: bool = ...
default_port: int = ...
file: Any | None
helo_resp: bytes | None
ehlo_msg: str
ehlo_resp: bytes | None
does_esmtp: bool
default_port: int
timeout: float
esmtp_features: dict[str, str]
command_encoding: str
@@ -130,7 +130,7 @@ class SMTP:
def quit(self) -> _Reply: ...
class SMTP_SSL(SMTP):
default_port: int = ...
default_port: int
keyfile: str | None
certfile: str | None
context: SSLContext

View File

@@ -1,27 +1,27 @@
from typing import Callable, Pattern
class TextWrapper:
width: int = ...
initial_indent: str = ...
subsequent_indent: str = ...
expand_tabs: bool = ...
replace_whitespace: bool = ...
fix_sentence_endings: bool = ...
drop_whitespace: bool = ...
break_long_words: bool = ...
break_on_hyphens: bool = ...
tabsize: int = ...
max_lines: int | None = ...
placeholder: str = ...
width: int
initial_indent: str
subsequent_indent: str
expand_tabs: bool
replace_whitespace: bool
fix_sentence_endings: bool
drop_whitespace: bool
break_long_words: bool
break_on_hyphens: bool
tabsize: int
max_lines: int | None
placeholder: str
# Attributes not present in documentation
sentence_end_re: Pattern[str] = ...
wordsep_re: Pattern[str] = ...
wordsep_simple_re: Pattern[str] = ...
whitespace_trans: str = ...
unicode_whitespace_trans: dict[int, int] = ...
uspace: int = ...
x: str = ... # leaked loop variable
sentence_end_re: Pattern[str]
wordsep_re: Pattern[str]
wordsep_simple_re: Pattern[str]
whitespace_trans: str
unicode_whitespace_trans: dict[int, int]
uspace: int
x: str # leaked loop variable
def __init__(
self,
width: int = ...,

View File

@@ -111,43 +111,43 @@ _XYScrollCommand = Union[str, Callable[[float, float], Any]] # -xscrollcommand
_TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -takefocus in manual page named 'options'
class EventType(str, Enum):
Activate: str = ...
ButtonPress: str = ...
ButtonRelease: str = ...
Circulate: str = ...
CirculateRequest: str = ...
ClientMessage: str = ...
Colormap: str = ...
Configure: str = ...
ConfigureRequest: str = ...
Create: str = ...
Deactivate: str = ...
Destroy: str = ...
Enter: str = ...
Expose: str = ...
FocusIn: str = ...
FocusOut: str = ...
GraphicsExpose: str = ...
Gravity: str = ...
KeyPress: str = ...
KeyRelease: str = ...
Keymap: str = ...
Leave: str = ...
Map: str = ...
MapRequest: str = ...
Mapping: str = ...
Motion: str = ...
MouseWheel: str = ...
NoExpose: str = ...
Property: str = ...
Reparent: str = ...
ResizeRequest: str = ...
Selection: str = ...
SelectionClear: str = ...
SelectionRequest: str = ...
Unmap: str = ...
VirtualEvent: str = ...
Visibility: str = ...
Activate: str
ButtonPress: str
ButtonRelease: str
Circulate: str
CirculateRequest: str
ClientMessage: str
Colormap: str
Configure: str
ConfigureRequest: str
Create: str
Deactivate: str
Destroy: str
Enter: str
Expose: str
FocusIn: str
FocusOut: str
GraphicsExpose: str
Gravity: str
KeyPress: str
KeyRelease: str
Keymap: str
Leave: str
Map: str
MapRequest: str
Mapping: str
Motion: str
MouseWheel: str
NoExpose: str
Property: str
Reparent: str
ResizeRequest: str
Selection: str
SelectionClear: str
SelectionRequest: str
Unmap: str
VirtualEvent: str
Visibility: str
_W = TypeVar("_W", bound="Misc")
# Events considered covariant because you should never assign to event.widget.

View File

@@ -1,8 +1,8 @@
from typing import Any, ClassVar, Mapping
class Dialog:
command: ClassVar[str | None] = ...
master: Any | None = ...
options: Mapping[str, Any] = ...
command: ClassVar[str | None]
master: Any | None
options: Mapping[str, Any]
def __init__(self, master: Any | None = ..., **options) -> None: ...
def show(self, **options) -> Any: ...

View File

@@ -4,7 +4,7 @@ from typing import Any, Mapping
DIALOG_ICON: str
class Dialog(Widget):
widgetName: str = ...
num: int = ...
widgetName: str
num: int
def __init__(self, master: Any | None = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ...
def destroy(self) -> None: ...

View File

@@ -6,25 +6,25 @@ from typing_extensions import Literal
dialogstates: dict[Any, Tuple[Any, Any]]
class FileDialog:
title: str = ...
master: Any = ...
directory: Any | None = ...
top: Toplevel = ...
botframe: Frame = ...
selection: Entry = ...
filter: Entry = ...
midframe: Entry = ...
filesbar: Scrollbar = ...
files: Listbox = ...
dirsbar: Scrollbar = ...
dirs: Listbox = ...
ok_button: Button = ...
filter_button: Button = ...
cancel_button: Button = ...
title: str
master: Any
directory: Any | None
top: Toplevel
botframe: Frame
selection: Entry
filter: Entry
midframe: Entry
filesbar: Scrollbar
files: Listbox
dirsbar: Scrollbar
dirs: Listbox
ok_button: Button
filter_button: Button
cancel_button: Button
def __init__(
self, master, title: Any | None = ...
) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either
how: Any | None = ...
how: Any | None
def go(self, dir_or_file: Any = ..., pattern: str = ..., default: str = ..., key: Any | None = ...): ...
def quit(self, how: Any | None = ...) -> None: ...
def dirs_double_event(self, event) -> None: ...
@@ -41,23 +41,23 @@ class FileDialog:
def set_selection(self, file) -> None: ...
class LoadFileDialog(FileDialog):
title: str = ...
title: str
def ok_command(self) -> None: ...
class SaveFileDialog(FileDialog):
title: str = ...
title: str
def ok_command(self): ...
class _Dialog(commondialog.Dialog): ...
class Open(_Dialog):
command: ClassVar[str] = ...
command: ClassVar[str]
class SaveAs(_Dialog):
command: ClassVar[str] = ...
command: ClassVar[str]
class Directory(commondialog.Dialog):
command: ClassVar[str] = ...
command: ClassVar[str]
# TODO: command kwarg available on macos
def asksaveasfilename(

View File

@@ -19,7 +19,7 @@ YES: str
NO: str
class Message(Dialog):
command: ClassVar[str] = ...
command: ClassVar[str]
def showinfo(title: str | None = ..., message: str | None = ..., **options: Any) -> str: ...
def showwarning(title: str | None = ..., message: str | None = ..., **options: Any) -> str: ...

View File

@@ -19,11 +19,11 @@ _PolygonCoords = Sequence[Tuple[float, float]]
Vec2D = Tuple[float, float]
class TurtleScreenBase(object):
cv: Canvas = ...
canvwidth: int = ...
canvheight: int = ...
xscale: float = ...
yscale: float = ...
cv: Canvas
canvwidth: int
canvheight: int
xscale: float
yscale: float
def __init__(self, cv: Canvas) -> None: ...
def mainloop(self) -> None: ...
def textinput(self, title: str, prompt: str) -> str | None: ...
@@ -93,10 +93,10 @@ class TurtleScreen(TurtleScreenBase):
onkeyrelease = onkey
class TNavigator(object):
START_ORIENTATION: dict[str, Vec2D] = ...
DEFAULT_MODE: str = ...
DEFAULT_ANGLEOFFSET: int = ...
DEFAULT_ANGLEORIENT: int = ...
START_ORIENTATION: dict[str, Vec2D]
DEFAULT_MODE: str
DEFAULT_ANGLEOFFSET: int
DEFAULT_ANGLEORIENT: int
def __init__(self, mode: str = ...) -> None: ...
def reset(self) -> None: ...
def degrees(self, fullcircle: float = ...) -> None: ...

View File

@@ -663,7 +663,7 @@ def cast(typ: object, val: Any) -> Any: ...
# NamedTuple is special-cased in the type checker
class NamedTuple(Tuple[Any, ...]):
_field_types: collections.OrderedDict[str, Type[Any]]
_field_defaults: dict[str, Any] = ...
_field_defaults: dict[str, Any]
_fields: Tuple[str, ...]
_source: str
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., **kwargs: Any) -> None: ...

View File

@@ -97,7 +97,7 @@ class Marshaller:
dispatch: dict[
Type[Any], Callable[[Marshaller, Any, Callable[[str], Any]], None]
] = ... # TODO: Replace 'Any' with some kind of binding
] # TODO: Replace 'Any' with some kind of binding
memo: dict[Any, None]
data: None
@@ -122,7 +122,7 @@ class Marshaller:
class Unmarshaller:
dispatch: dict[str, Callable[[Unmarshaller, str], None]] = ...
dispatch: dict[str, Callable[[Unmarshaller, str], None]]
_type: str | None
_stack: list[_Marshallable]
@@ -212,9 +212,9 @@ class _Method: # undocumented
class Transport:
user_agent: str = ...
accept_gzip_encoding: bool = ...
encode_threshold: int | None = ...
user_agent: str
accept_gzip_encoding: bool
encode_threshold: int | None
_use_datetime: bool
_use_builtin_types: bool

View File

@@ -64,8 +64,8 @@ class SimpleXMLRPCDispatcher: # undocumented
class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler):
rpc_paths: Tuple[str, str] = ...
encode_threshold: int = ... # undocumented
rpc_paths: Tuple[str, str]
encode_threshold: int # undocumented
aepattern: Pattern[str] # undocumented
def accept_encodings(self) -> dict[str, float]: ...
def is_rpc_path_valid(self) -> bool: ...
@@ -76,8 +76,8 @@ class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler):
class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher):
allow_reuse_address: bool = ...
_send_traceback_handler: bool = ...
allow_reuse_address: bool
_send_traceback_handler: bool
def __init__(
self,
addr: Tuple[str, int],

View File

@@ -26,11 +26,11 @@ class _ClosableZipStream(_ZipStream, Protocol):
def close(self) -> object: ...
class ZipExtFile(io.BufferedIOBase):
MAX_N: int = ...
MIN_READ_SIZE: int = ...
MAX_N: int
MIN_READ_SIZE: int
if sys.version_info >= (3, 7):
MAX_SEEK_READ: int = ...
MAX_SEEK_READ: int
newlines: list[bytes] | None
mode: str