Skip to content

Great cleanup! #8594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions stdlib/calendar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
11 changes: 1 addition & 10 deletions stdlib/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
21 changes: 3 additions & 18 deletions stdlib/csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions stdlib/datetime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: ...
Expand All @@ -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: ...
Expand All @@ -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]: ...
11 changes: 1 addition & 10 deletions stdlib/doctest.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...

Expand All @@ -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,
Expand Down
22 changes: 2 additions & 20 deletions stdlib/email/_header_value_parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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]
Expand Down
12 changes: 3 additions & 9 deletions stdlib/email/parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...
6 changes: 0 additions & 6 deletions stdlib/encodings/utf_8_sig.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
18 changes: 1 addition & 17 deletions stdlib/formatter.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
6 changes: 0 additions & 6 deletions stdlib/gzip.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
3 changes: 0 additions & 3 deletions stdlib/html/parser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion stdlib/http/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
6 changes: 1 addition & 5 deletions stdlib/http/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: ...
Expand All @@ -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 = ...
Expand Down
16 changes: 0 additions & 16 deletions stdlib/imaplib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,18 @@ 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):
def open(self, host: str = ..., port: int | None = ..., timeout: float | None = ...) -> None: ...
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]
Expand All @@ -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: ...
Expand Down
Loading