diff --git a/stdlib/calendar.pyi b/stdlib/calendar.pyi index 4faee805333b..be76ecd40f5d 100644 --- a/stdlib/calendar.pyi +++ b/stdlib/calendar.pyi @@ -111,8 +111,6 @@ class different_locale: class LocaleTextCalendar(TextCalendar): def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ... - def formatweekday(self, day: int, width: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... class LocaleHTMLCalendar(HTMLCalendar): def __init__(self, firstweekday: int = ..., locale: _LocaleType | None = ...) -> None: ... diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 3885abf8db91..897bdb71eaed 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -98,23 +98,14 @@ class _Waiter: class _AsCompletedWaiter(_Waiter): lock: threading.Lock def __init__(self) -> None: ... - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... -class _FirstCompletedWaiter(_Waiter): - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... +class _FirstCompletedWaiter(_Waiter): ... class _AllCompletedWaiter(_Waiter): num_pending_calls: int stop_on_exception: bool lock: threading.Lock def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ... - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... class _AcquireFutures: futures: Iterable[Future[Any]] diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index e9552c759c16..73067c6803d4 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -60,24 +60,9 @@ __all__ = [ _T = TypeVar("_T") -class excel(Dialect): - delimiter: str - quotechar: str - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType - -class excel_tab(excel): - delimiter: str - -class unix_dialect(Dialect): - delimiter: str - quotechar: str - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType +class excel(Dialect): ... +class excel_tab(excel): ... +class unix_dialect(Dialect): ... class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): fieldnames: Sequence[_T] | None diff --git a/stdlib/datetime.pyi b/stdlib/datetime.pyi index 780ee941baa5..5926ff0a808e 100644 --- a/stdlib/datetime.pyi +++ b/stdlib/datetime.pyi @@ -201,7 +201,6 @@ class timedelta(SupportsAbs[timedelta]): class datetime(date): min: ClassVar[datetime] max: ClassVar[datetime] - resolution: ClassVar[timedelta] def __new__( cls: type[Self], year: int, @@ -249,8 +248,6 @@ class datetime(date): def utcnow(cls: type[Self]) -> Self: ... @classmethod def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> datetime: ... - @classmethod - def fromisoformat(cls: type[Self], __date_string: str) -> Self: ... def timestamp(self) -> float: ... def utctimetuple(self) -> struct_time: ... def date(self) -> _Date: ... @@ -274,7 +271,6 @@ class datetime(date): else: def astimezone(self, tz: _TzInfo | None = ...) -> datetime: ... - def ctime(self) -> str: ... def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... @classmethod def strptime(cls, __date_string: str, __format: str) -> datetime: ... @@ -298,7 +294,3 @@ class datetime(date): def __sub__(self, __other: datetime) -> timedelta: ... @overload def __sub__(self, __other: timedelta) -> datetime: ... - if sys.version_info >= (3, 9): - def isocalendar(self) -> _IsoCalendarDate: ... - else: - def isocalendar(self) -> tuple[int, int, int]: ... diff --git a/stdlib/doctest.pyi b/stdlib/doctest.pyi index 382d9578ce80..579f2481978c 100644 --- a/stdlib/doctest.pyi +++ b/stdlib/doctest.pyi @@ -203,20 +203,13 @@ class DocTestCase(unittest.TestCase): tearDown: Callable[[DocTest], object] | None = ..., checker: OutputChecker | None = ..., ) -> None: ... - def setUp(self) -> None: ... - def tearDown(self) -> None: ... def runTest(self) -> None: ... def format_failure(self, err: str) -> str: ... - def debug(self) -> None: ... - def id(self) -> str: ... def __eq__(self, other: object) -> bool: ... - def shortDescription(self) -> str: ... class SkipDocTestCase(DocTestCase): def __init__(self, module: types.ModuleType) -> None: ... - def setUp(self) -> None: ... def test_skip(self) -> None: ... - def shortDescription(self) -> str: ... class _DocTestSuite(unittest.TestSuite): ... @@ -228,9 +221,7 @@ def DocTestSuite( **options: Any, ) -> _DocTestSuite: ... -class DocFileCase(DocTestCase): - def id(self) -> str: ... - def format_failure(self, err: str) -> str: ... +class DocFileCase(DocTestCase): ... def DocFileTest( path: str, diff --git a/stdlib/email/_header_value_parser.pyi b/stdlib/email/_header_value_parser.pyi index 00d5c9882429..28a851d2f4e7 100644 --- a/stdlib/email/_header_value_parser.pyi +++ b/stdlib/email/_header_value_parser.pyi @@ -42,11 +42,7 @@ class TokenList(list[TokenList | Terminal]): def pprint(self, indent: str = ...) -> None: ... def ppstr(self, indent: str = ...) -> str: ... -class WhiteSpaceTokenList(TokenList): - @property - def value(self) -> str: ... - @property - def comments(self) -> list[str]: ... +class WhiteSpaceTokenList(TokenList): ... class UnstructuredTokenList(TokenList): token_type: str @@ -84,16 +80,12 @@ class QuotedString(TokenList): class BareQuotedString(QuotedString): token_type: str - @property - def value(self) -> str: ... class Comment(WhiteSpaceTokenList): token_type: str def quote(self, value: Any) -> str: ... @property def content(self) -> str: ... - @property - def comments(self) -> list[str]: ... class AddressList(TokenList): token_type: str @@ -217,8 +209,6 @@ class AddrSpec(TokenList): @property def domain(self) -> str: ... @property - def value(self) -> str: ... - @property def addr_spec(self) -> str: ... class ObsLocalPart(TokenList): @@ -227,18 +217,13 @@ class ObsLocalPart(TokenList): class DisplayName(Phrase): 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 @property - def value(self) -> str: ... - @property def local_part(self) -> str: ... class DomainLiteral(TokenList): @@ -352,10 +337,7 @@ class ValueTerminal(Terminal): def value(self) -> ValueTerminal: ... def startswith_fws(self) -> bool: ... -class EWWhiteSpaceTerminal(WhiteSpaceTerminal): - @property - def value(self) -> str: ... - +class EWWhiteSpaceTerminal(WhiteSpaceTerminal): ... class _InvalidEwError(HeaderParseError): ... DOT: Final[ValueTerminal] diff --git a/stdlib/email/parser.pyi b/stdlib/email/parser.pyi index dcd346c1b46d..bf51c45728fd 100644 --- a/stdlib/email/parser.pyi +++ b/stdlib/email/parser.pyi @@ -11,17 +11,11 @@ class Parser: def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... -class HeaderParser(Parser): - def __init__(self, _class: Callable[[], Message] | None = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... - def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... - -class BytesHeaderParser(BytesParser): - def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... - def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... - def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... +class HeaderParser(Parser): ... class BytesParser: def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + +class BytesHeaderParser(BytesParser): ... diff --git a/stdlib/encodings/utf_8_sig.pyi b/stdlib/encodings/utf_8_sig.pyi index bf52e8a6f3d3..ad0d5bdc4fc7 100644 --- a/stdlib/encodings/utf_8_sig.pyi +++ b/stdlib/encodings/utf_8_sig.pyi @@ -3,23 +3,17 @@ import codecs class IncrementalEncoder(codecs.IncrementalEncoder): def __init__(self, errors: str = ...) -> None: ... def encode(self, input: str, final: bool = ...) -> bytes: ... - def reset(self) -> None: ... def getstate(self) -> int: ... # type: ignore[override] def setstate(self, state: int) -> None: ... # type: ignore[override] class IncrementalDecoder(codecs.BufferedIncrementalDecoder): def __init__(self, errors: str = ...) -> None: ... def _buffer_decode(self, input: bytes, errors: str | None, final: bool) -> tuple[str, int]: ... - def reset(self) -> None: ... - def getstate(self) -> tuple[bytes, int]: ... - def setstate(self, state: tuple[bytes, int]) -> None: ... class StreamWriter(codecs.StreamWriter): - def reset(self) -> None: ... def encode(self, input: str, errors: str | None = ...) -> tuple[bytes, int]: ... class StreamReader(codecs.StreamReader): - def reset(self) -> None: ... def decode(self, input: bytes, errors: str | None = ...) -> tuple[str, int]: ... def getregentry() -> codecs.CodecInfo: ... diff --git a/stdlib/formatter.pyi b/stdlib/formatter.pyi index 0aac0a5f918c..642a3463b714 100644 --- a/stdlib/formatter.pyi +++ b/stdlib/formatter.pyi @@ -78,28 +78,12 @@ class NullWriter: def send_flowing_data(self, data: str) -> None: ... def send_literal_data(self, data: str) -> None: ... -class AbstractWriter(NullWriter): - def new_alignment(self, align: str | None) -> None: ... - def new_font(self, font: _FontType) -> None: ... - def new_margin(self, margin: int, level: int) -> None: ... - def new_spacing(self, spacing: str | None) -> None: ... - def new_styles(self, styles: tuple[Any, ...]) -> None: ... - def send_paragraph(self, blankline: int) -> None: ... - def send_line_break(self) -> None: ... - def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def send_label_data(self, data: str) -> None: ... - def send_flowing_data(self, data: str) -> None: ... - def send_literal_data(self, data: str) -> None: ... +class AbstractWriter(NullWriter): ... class DumbWriter(NullWriter): file: IO[str] maxcol: int def __init__(self, file: IO[str] | None = ..., maxcol: int = ...) -> None: ... def reset(self) -> None: ... - def send_paragraph(self, blankline: int) -> None: ... - def send_line_break(self) -> None: ... - def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def send_literal_data(self, data: str) -> None: ... - def send_flowing_data(self, data: str) -> None: ... def test(file: str | None = ...) -> None: ... diff --git a/stdlib/gzip.pyi b/stdlib/gzip.pyi index abf12925aea2..d65b8f100212 100644 --- a/stdlib/gzip.pyi +++ b/stdlib/gzip.pyi @@ -142,21 +142,15 @@ class GzipFile(_compression.BaseStream): def read(self, size: int | None = ...) -> bytes: ... def read1(self, size: int = ...) -> bytes: ... def peek(self, n: int) -> bytes: ... - @property - def closed(self) -> bool: ... def close(self) -> None: ... def flush(self, zlib_mode: int = ...) -> None: ... def fileno(self) -> int: ... def rewind(self) -> None: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def seekable(self) -> bool: ... def seek(self, offset: int, whence: int = ...) -> int: ... def readline(self, size: int | None = ...) -> bytes: ... class _GzipReader(_compression.DecompressReader): def __init__(self, fp: _ReadableFileobj) -> None: ... - def read(self, size: int = ...) -> bytes: ... if sys.version_info >= (3, 8): def compress(data: bytes, compresslevel: int = ..., *, mtime: float | None = ...) -> bytes: ... diff --git a/stdlib/html/parser.pyi b/stdlib/html/parser.pyi index 2948eadc9800..6dde9f705978 100644 --- a/stdlib/html/parser.pyi +++ b/stdlib/html/parser.pyi @@ -7,8 +7,6 @@ class HTMLParser(ParserBase): def __init__(self, *, convert_charrefs: bool = ...) -> None: ... def feed(self, data: str) -> None: ... def close(self) -> None: ... - def reset(self) -> None: ... - def getpos(self) -> tuple[int, int]: ... def get_starttag_text(self) -> str | None: ... def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ... def handle_endtag(self, tag: str) -> None: ... @@ -19,7 +17,6 @@ class HTMLParser(ParserBase): def handle_comment(self, data: str) -> None: ... def handle_decl(self, decl: str) -> None: ... def handle_pi(self, data: str) -> None: ... - def unknown_decl(self, data: str) -> None: ... CDATA_CONTENT_ELEMENTS: tuple[str, ...] def check_for_whole_start_tag(self, i: int) -> int: ... # undocumented def clear_cdata_mode(self) -> None: ... # undocumented diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 08c3f2c8be0b..2ce52eac9ad9 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -125,7 +125,6 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): @overload def getheader(self, name: str, default: _T) -> str | _T: ... def getheaders(self) -> list[tuple[str, str]]: ... - def fileno(self) -> int: ... def isclosed(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... def __enter__(self: Self) -> Self: ... diff --git a/stdlib/http/server.pyi b/stdlib/http/server.pyi index e73497bb18bc..40c94bf62f30 100644 --- a/stdlib/http/server.pyi +++ b/stdlib/http/server.pyi @@ -11,12 +11,10 @@ class HTTPServer(socketserver.TCPServer): server_name: str server_port: int -class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): - daemon_threads: bool # undocumented +class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): ... class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): client_address: tuple[str, int] - server: socketserver.BaseServer close_connection: bool requestline: str command: str @@ -34,7 +32,6 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): 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: ... def handle_expect_100(self) -> bool: ... def send_error(self, code: int, message: str | None = ..., explain: str | None = ...) -> None: ... @@ -53,7 +50,6 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): def parse_request(self) -> bool: ... # undocumented class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): - server_version: str extensions_map: dict[str, str] def __init__( self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ... diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index a313b20a999f..804826f5e931 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -128,9 +128,6 @@ class IMAP4_SSL(IMAP4): certfile: str | None = ..., ssl_context: SSLContext | None = ..., ) -> None: ... - host: str - port: int - sock: _socket sslobj: SSLSocket file: IO[Any] if sys.version_info >= (3, 9): @@ -138,19 +135,11 @@ class IMAP4_SSL(IMAP4): else: def open(self, host: str = ..., port: int | None = ...) -> None: ... - def read(self, size: int) -> bytes: ... - def readline(self) -> bytes: ... - def send(self, data: bytes) -> None: ... - def shutdown(self) -> None: ... - def socket(self) -> _socket: ... def ssl(self) -> SSLSocket: ... class IMAP4_stream(IMAP4): command: str def __init__(self, command: str) -> None: ... - host: str - port: int - sock: _socket file: IO[Any] process: subprocess.Popen[bytes] writefile: IO[Any] @@ -160,11 +149,6 @@ class IMAP4_stream(IMAP4): else: def open(self, host: str | None = ..., port: int | None = ...) -> None: ... - def read(self, size: int) -> bytes: ... - def readline(self) -> bytes: ... - def send(self, data: bytes) -> None: ... - def shutdown(self) -> None: ... - class _Authenticator: mech: Callable[[bytes], bytes] def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index b46d42a4199a..d3eb761ba02d 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -36,6 +36,14 @@ _Path: TypeAlias = bytes | str class Finder(metaclass=ABCMeta): ... +class Loader(metaclass=ABCMeta): + def load_module(self, fullname: str) -> types.ModuleType: ... + def module_repr(self, module: types.ModuleType) -> str: ... + def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... + # Not defined on the actual class for backwards-compatibility reasons, + # but expected in new code. + def exec_module(self, module: types.ModuleType) -> None: ... + class ResourceLoader(Loader): @abstractmethod def get_data(self, path: _Path) -> bytes: ... @@ -43,7 +51,6 @@ class ResourceLoader(Loader): class InspectLoader(Loader): def is_package(self, fullname: str) -> bool: ... def get_code(self, fullname: str) -> types.CodeType | None: ... - def load_module(self, fullname: str) -> types.ModuleType: ... @abstractmethod def get_source(self, fullname: str) -> str | None: ... def exec_module(self, module: types.ModuleType) -> None: ... @@ -53,7 +60,6 @@ class InspectLoader(Loader): class ExecutionLoader(InspectLoader): @abstractmethod def get_filename(self, fullname: str) -> _Path: ... - def get_code(self, fullname: str) -> types.CodeType | None: ... class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): def path_mtime(self, path: _Path) -> float: ... @@ -77,14 +83,6 @@ class PathEntryFinder(Finder): # Not defined on the actual class, but expected to exist. def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ... -class Loader(metaclass=ABCMeta): - def load_module(self, fullname: str) -> types.ModuleType: ... - def module_repr(self, module: types.ModuleType) -> str: ... - def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... - # Not defined on the actual class for backwards-compatibility reasons, - # but expected in new code. - def exec_module(self, module: types.ModuleType) -> None: ... - class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): name: str path: _Path diff --git a/stdlib/importlib/machinery.pyi b/stdlib/importlib/machinery.pyi index 09abdc6f34fd..ba6ed30629e0 100644 --- a/stdlib/importlib/machinery.pyi +++ b/stdlib/importlib/machinery.pyi @@ -145,6 +145,5 @@ class ExtensionFileLoader(importlib.abc.ExecutionLoader): def get_source(self, fullname: str) -> None: ... def create_module(self, spec: ModuleSpec) -> types.ModuleType: ... def exec_module(self, module: types.ModuleType) -> None: ... - def is_package(self, fullname: str) -> bool: ... def get_code(self, fullname: str) -> None: ... def __eq__(self, other: object) -> bool: ... diff --git a/stdlib/importlib/util.pyi b/stdlib/importlib/util.pyi index dca4778fd416..4d75032ab44a 100644 --- a/stdlib/importlib/util.pyi +++ b/stdlib/importlib/util.pyi @@ -35,7 +35,6 @@ class LazyLoader(importlib.abc.Loader): def __init__(self, loader: importlib.abc.Loader) -> None: ... @classmethod def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ... - def create_module(self, spec: importlib.machinery.ModuleSpec) -> types.ModuleType | None: ... def exec_module(self, module: types.ModuleType) -> None: ... def source_hash(source_bytes: bytes) -> int: ... diff --git a/stdlib/io.pyi b/stdlib/io.pyi index f47a9ddf334c..3e9a6cd6861d 100644 --- a/stdlib/io.pyi +++ b/stdlib/io.pyi @@ -117,7 +117,6 @@ class BufferedReader(BufferedIOBase, BinaryIO): def __enter__(self: Self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def peek(self, __size: int = ...) -> bytes: ... - def read1(self, __size: int = ...) -> bytes: ... class BufferedWriter(BufferedIOBase, BinaryIO): def __enter__(self: Self) -> Self: ... @@ -126,9 +125,7 @@ class BufferedWriter(BufferedIOBase, BinaryIO): class BufferedRandom(BufferedReader, BufferedWriter): def __enter__(self: Self) -> Self: ... - def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def seek(self, __target: int, __whence: int = ...) -> int: ... - def read1(self, __size: int = ...) -> bytes: ... + def seek(self, __target: int, __whence: int = ...) -> int: ... # stubtest needs this class BufferedRWPair(BufferedIOBase): def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ... @@ -146,7 +143,6 @@ class TextIOBase(IOBase): def readline(self, __size: int = ...) -> str: ... # type: ignore[override] def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override] def read(self, __size: int | None = ...) -> str: ... - def tell(self) -> int: ... class TextIOWrapper(TextIOBase, TextIO): def __init__( @@ -182,7 +178,7 @@ class TextIOWrapper(TextIOBase, TextIO): def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override] def readline(self, __size: int = ...) -> str: ... # type: ignore[override] def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override] - def seek(self, __cookie: int, __whence: int = ...) -> int: ... + def seek(self, __cookie: int, __whence: int = ...) -> int: ... # stubtest needs this class StringIO(TextIOWrapper): def __init__(self, initial_value: str | None = ..., newline: str | None = ...) -> None: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 0d3e80ddcf00..40b30ae98509 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -272,7 +272,6 @@ class Logger(Filterer): stack_info: bool = ..., ) -> None: ... # undocumented fatal = critical - def filter(self, record: LogRecord) -> bool: ... def addHandler(self, hdlr: Handler) -> None: ... def removeHandler(self, hdlr: Handler) -> None: ... if sys.version_info >= (3, 8): @@ -319,7 +318,6 @@ class Handler(Filterer): def release(self) -> None: ... def setLevel(self, level: _Level) -> None: ... def setFormatter(self, fmt: Formatter | None) -> None: ... - def filter(self, record: LogRecord) -> bool: ... def flush(self) -> None: ... def close(self) -> None: ... def handle(self, record: LogRecord) -> bool: ... diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index d4c7977b8d0a..868da0f05567 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -116,20 +116,12 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): filters: _FilterChain | None = ..., ) -> None: ... def __enter__(self: Self) -> Self: ... - def close(self) -> None: ... - @property - def closed(self) -> bool: ... - def fileno(self) -> int: ... - def seekable(self) -> bool: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... def peek(self, size: int = ...) -> bytes: ... def read(self, size: int | None = ...) -> bytes: ... def read1(self, size: int = ...) -> bytes: ... def readline(self, size: int | None = ...) -> bytes: ... def write(self, data: ReadableBuffer) -> int: ... def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... @overload def open( diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index 16b7cfe9e890..d078127c9ccf 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -137,7 +137,6 @@ class Process(BaseProcess): class DefaultContext(BaseContext): Process: ClassVar[type[Process]] def __init__(self, context: BaseContext) -> None: ... - def set_start_method(self, method: str | None, force: bool = ...) -> None: ... def get_start_method(self, allow_none: bool = ...) -> str: ... def get_all_start_methods(self) -> list[str]: ... if sys.version_info < (3, 8): diff --git a/stdlib/multiprocessing/popen_forkserver.pyi b/stdlib/multiprocessing/popen_forkserver.pyi index d28c7245fd54..f7d53bbb3e41 100644 --- a/stdlib/multiprocessing/popen_forkserver.pyi +++ b/stdlib/multiprocessing/popen_forkserver.pyi @@ -1,5 +1,4 @@ import sys -from multiprocessing.process import BaseProcess from typing import ClassVar from . import popen_fork @@ -15,8 +14,3 @@ if sys.platform != "win32": class Popen(popen_fork.Popen): DupFd: ClassVar[type[_DupFd]] finalizer: Finalize - sentinel: int - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, fd: int) -> int: ... - def poll(self, flag: int = ...) -> int | None: ... diff --git a/stdlib/multiprocessing/popen_spawn_posix.pyi b/stdlib/multiprocessing/popen_spawn_posix.pyi index 81aaac7ca459..7e81d39600ad 100644 --- a/stdlib/multiprocessing/popen_spawn_posix.pyi +++ b/stdlib/multiprocessing/popen_spawn_posix.pyi @@ -1,5 +1,4 @@ import sys -from multiprocessing.process import BaseProcess from typing import ClassVar from . import popen_fork @@ -19,6 +18,3 @@ if sys.platform != "win32": finalizer: Finalize pid: int # may not exist if _launch raises in second try / except sentinel: int # may not exist if _launch raises in second try / except - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, fd: int) -> int: ... diff --git a/stdlib/multiprocessing/queues.pyi b/stdlib/multiprocessing/queues.pyi index 1d31fa694c45..02a67216c72b 100644 --- a/stdlib/multiprocessing/queues.pyi +++ b/stdlib/multiprocessing/queues.pyi @@ -15,18 +15,13 @@ class Queue(queue.Queue[_T]): def __init__(self, maxsize: int = ..., *, ctx: Any = ...) -> None: ... def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ... def put(self, obj: _T, block: bool = ..., timeout: float | None = ...) -> None: ... - def qsize(self) -> int: ... - def empty(self) -> bool: ... - def full(self) -> bool: ... def put_nowait(self, item: _T) -> None: ... def get_nowait(self) -> _T: ... def close(self) -> None: ... def join_thread(self) -> None: ... def cancel_join_thread(self) -> None: ... -class JoinableQueue(Queue[_T]): - def task_done(self) -> None: ... - def join(self) -> None: ... +class JoinableQueue(Queue[_T]): ... class SimpleQueue(Generic[_T]): def __init__(self, *, ctx: Any = ...) -> None: ... diff --git a/stdlib/optparse.pyi b/stdlib/optparse.pyi index b571ff0680b7..5cff39717a7b 100644 --- a/stdlib/optparse.pyi +++ b/stdlib/optparse.pyi @@ -42,7 +42,6 @@ class AmbiguousOptionError(BadOptionError): def __init__(self, opt_str: str, possibilities: Sequence[str]) -> None: ... class OptionError(OptParseError): - msg: str option_id: str def __init__(self, msg: str, option: Option) -> None: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index abcffc31111a..7f35f5eebe18 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -60,11 +60,6 @@ class Doc: def getdocloc(self, object: object, basedir: str = ...) -> str | None: ... class HTMLRepr(Repr): - maxlist: int - maxtuple: int - maxdict: int - maxstring: int - maxother: int def __init__(self) -> None: ... def escape(self, text: str) -> str: ... def repr(self, object: object) -> str: ... @@ -153,11 +148,6 @@ class HTMLDoc(Doc): def filelink(self, url: str, path: str) -> str: ... class TextRepr(Repr): - maxlist: int - maxtuple: int - maxdict: int - maxstring: int - maxother: int def __init__(self) -> None: ... def repr1(self, x: object, level: complex) -> str: ... def repr_string(self, x: str, level: complex) -> str: ... diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 3bb999bfaaa6..a2a1d956e78f 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -50,7 +50,6 @@ class Random(_random.Random): def getstate(self) -> tuple[Any, ...]: ... def setstate(self, state: tuple[Any, ...]) -> None: ... - def getrandbits(self, __k: int) -> int: ... def randrange(self, start: int, stop: int | None = ..., step: int = ...) -> int: ... def randint(self, a: int, b: int) -> int: ... if sys.version_info >= (3, 9): @@ -78,7 +77,6 @@ class Random(_random.Random): else: def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... - def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ... def betavariate(self, alpha: float, beta: float) -> float: ... diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index c42841c43e7f..2d03b60e7bb4 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -49,7 +49,6 @@ class SMTPResponseException(SMTPException): def __init__(self, code: int, msg: bytes | str) -> None: ... class SMTPSenderRefused(SMTPResponseException): - smtp_code: int smtp_error: bytes sender: str args: tuple[int, bytes, str] @@ -151,7 +150,6 @@ class SMTP: def quit(self) -> _Reply: ... class SMTP_SSL(SMTP): - default_port: int keyfile: str | None certfile: str | None context: SSLContext diff --git a/stdlib/socketserver.pyi b/stdlib/socketserver.pyi index 7565c3ca1bb8..e597818ef7da 100644 --- a/stdlib/socketserver.pyi +++ b/stdlib/socketserver.pyi @@ -72,7 +72,6 @@ class BaseServer: class TCPServer(BaseServer): if sys.version_info >= (3, 11): allow_reuse_port: bool - request_queue_size: int def __init__( self: Self, server_address: tuple[str, int], diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 28fce697f2ca..964f0b621e25 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -344,12 +344,6 @@ class ModuleType: @final class GeneratorType(Generator[_T_co, _T_contra, _V_co]): - @property - def gi_code(self) -> CodeType: ... - @property - def gi_frame(self) -> FrameType: ... - @property - def gi_running(self) -> bool: ... @property def gi_yieldfrom(self) -> GeneratorType[_T_co, _T_contra, Any] | None: ... if sys.version_info >= (3, 11): @@ -359,7 +353,6 @@ class GeneratorType(Generator[_T_co, _T_contra, _V_co]): __qualname__: str def __iter__(self) -> GeneratorType[_T_co, _T_contra, _V_co]: ... def __next__(self) -> _T_co: ... - def close(self) -> None: ... def send(self, __arg: _T_contra) -> _T_co: ... @overload def throw( @@ -372,12 +365,6 @@ class GeneratorType(Generator[_T_co, _T_contra, _V_co]): class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]): @property def ag_await(self) -> Awaitable[Any] | None: ... - @property - def ag_frame(self) -> FrameType: ... - @property - def ag_running(self) -> bool: ... - @property - def ag_code(self) -> CodeType: ... __name__: str __qualname__: str def __aiter__(self) -> AsyncGeneratorType[_T_co, _T_contra]: ... @@ -398,14 +385,6 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]): __name__: str __qualname__: str @property - def cr_await(self) -> Any | None: ... - @property - def cr_code(self) -> CodeType: ... - @property - def cr_frame(self) -> FrameType: ... - @property - def cr_running(self) -> bool: ... - @property def cr_origin(self) -> tuple[tuple[str, int, str], ...] | None: ... if sys.version_info >= (3, 11): @property diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 4732994594f8..9dab412f4228 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -343,11 +343,8 @@ patch: _patcher class MagicMixin: def __init__(self, *args: Any, **kw: Any) -> None: ... -class NonCallableMagicMock(MagicMixin, NonCallableMock): - def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... - -class MagicMock(MagicMixin, Mock): - def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... +class NonCallableMagicMock(MagicMixin, NonCallableMock): ... +class MagicMock(MagicMixin, Mock): ... if sys.version_info >= (3, 8): class AsyncMockMixin(Base): diff --git a/stdlib/unittest/runner.pyi b/stdlib/unittest/runner.pyi index 1f1b89bc1bee..17514828898a 100644 --- a/stdlib/unittest/runner.pyi +++ b/stdlib/unittest/runner.pyi @@ -16,7 +16,6 @@ class TextTestResult(unittest.result.TestResult): stream: TextIO # undocumented def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... def getDescription(self, test: unittest.case.TestCase) -> str: ... - def printErrors(self) -> None: ... def printErrorList(self, flavour: str, errors: Iterable[tuple[unittest.case.TestCase, str]]) -> None: ... class TextTestRunner: diff --git a/stdlib/urllib/request.pyi b/stdlib/urllib/request.pyi index 88f4f5250e67..3cd5fc740fca 100644 --- a/stdlib/urllib/request.pyi +++ b/stdlib/urllib/request.pyi @@ -282,9 +282,6 @@ class CacheFTPHandler(FTPHandler): def setMaxConns(self, m: int) -> None: ... def check_cache(self) -> None: ... # undocumented def clear_cache(self) -> None: ... # undocumented - def connect_ftp( - self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float - ) -> ftpwrapper: ... # undocumented class UnknownHandler(BaseHandler): def unknown_open(self, req: Request) -> NoReturn: ... diff --git a/stdlib/wsgiref/simple_server.pyi b/stdlib/wsgiref/simple_server.pyi index 1dc84e9fbebe..547f562cc1d4 100644 --- a/stdlib/wsgiref/simple_server.pyi +++ b/stdlib/wsgiref/simple_server.pyi @@ -12,7 +12,6 @@ software_version: str # undocumented class ServerHandler(SimpleHandler): # undocumented server_software: str - def close(self) -> None: ... class WSGIServer(HTTPServer): application: WSGIApplication | None @@ -25,7 +24,6 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): server_version: str def get_environ(self) -> WSGIEnvironment: ... def get_stderr(self) -> ErrorStream: ... - def handle(self) -> None: ... def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ... diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 7c0ba5c62fd7..150291009f54 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -203,7 +203,6 @@ class GzipDecodedResponse(gzip.GzipFile): # undocumented io: BytesIO def __init__(self, response: SupportsRead[bytes]) -> None: ... - def close(self) -> None: ... class _Method: # undocumented diff --git a/stdlib/xmlrpc/server.pyi b/stdlib/xmlrpc/server.pyi index e4fc300343bf..96abf7d3d63b 100644 --- a/stdlib/xmlrpc/server.pyi +++ b/stdlib/xmlrpc/server.pyi @@ -72,11 +72,9 @@ class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler): def do_POST(self) -> None: ... def decode_request_content(self, data: bytes) -> bytes | None: ... def report_404(self) -> None: ... - def log_request(self, code: int | str = ..., size: int | str = ...) -> None: ... class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): - allow_reuse_address: bool _send_traceback_handler: bool def __init__( self, @@ -92,8 +90,6 @@ class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented dispatchers: dict[str, SimpleXMLRPCDispatcher] - allow_none: bool - encoding: str def __init__( self, addr: tuple[str, int], @@ -106,12 +102,6 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented ) -> None: ... def add_dispatcher(self, path: str, dispatcher: SimpleXMLRPCDispatcher) -> SimpleXMLRPCDispatcher: ... def get_dispatcher(self, path: str) -> SimpleXMLRPCDispatcher: ... - def _marshaled_dispatch( - self, - data: str, - dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ..., - path: Any | None = ..., - ) -> str: ... class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): def __init__(self, allow_none: bool = ..., encoding: str | None = ..., use_builtin_types: bool = ...) -> None: ...