typeshed: remove crufty comments (#4699)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-10-23 00:40:06 -07:00
committed by GitHub
parent 3de732e188
commit 6ff5b88ca7
270 changed files with 16 additions and 684 deletions

View File

@@ -1,5 +1,3 @@
# Stubs for BaseHTTPServer (Python 2.7)
import mimetools
import SocketServer
from typing import Any, BinaryIO, Callable, Mapping, Optional, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for CGIHTTPServer (Python 2.7)
import SimpleHTTPServer
from typing import List

View File

@@ -1,5 +1,3 @@
# Stubs for Queue (Python 2)
from collections import deque
from typing import Any, Deque, Generic, Optional, TypeVar

View File

@@ -1,5 +1,3 @@
# Stubs for SimpleHTTPServer (Python 2)
import BaseHTTPServer
from StringIO import StringIO
from typing import IO, Any, AnyStr, Mapping, Optional, Union

View File

@@ -1,6 +1,3 @@
# NB: SocketServer.pyi and socketserver.pyi must remain consistent!
# Stubs for socketserver
import sys
import types
from socket import SocketType

View File

@@ -1,5 +1,3 @@
# Stubs for StringIO (Python 2)
from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List, Optional
class StringIO(IO[AnyStr], Generic[AnyStr]):

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_collections' module."""
from typing import Any, Callable, Dict, Generic, Iterator, Optional, TypeVar, Union
_K = TypeVar("_K")

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_functools' module."""
from typing import Any, Callable, Dict, Iterable, Optional, Tuple, TypeVar, overload
_T = TypeVar("_T")

View File

@@ -1,8 +1,3 @@
"""Stub file for the '_hotshot' module."""
# This is an autogenerated file. It serves as a starting point
# for a more precise manual annotation of this module.
# Feel free to edit the source below, but remove this header when you do.
from typing import Any, Dict, Generic, List, Tuple
def coverage(a: str) -> Any: ...

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_sre' module."""
from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union, overload
CODESIZE: int

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_struct' module."""
from typing import Any, AnyStr, Tuple
class error(Exception): ...

View File

@@ -1,4 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/_threading_local.py
from typing import Any
class _localbase(object): ...

View File

@@ -1,12 +1,7 @@
# Stubs for cStringIO (Python 2.7)
# See https://docs.python.org/2/library/stringio.html
from abc import ABCMeta
from types import TracebackType
from typing import IO, Iterable, Iterator, List, Optional, Union, overload
# TODO the typing.IO[] generics should be split into input and output.
# This class isn't actually abstract, but you can't instantiate it
# directly, so we might as well treat it as abstract in the stub.
class InputType(IO[str], Iterator[str], metaclass=ABCMeta):

View File

@@ -1,5 +1,3 @@
# These are not exported.
# These are exported.
from typing import (
AbstractSet,
Any,

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/dircache.py
from typing import List, MutableSequence, Text, Union
def reset() -> None: ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.archive_util
from typing import Optional
def make_archive(

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.bcppcompiler
from distutils.ccompiler import CCompiler
class BCPPCompiler(CCompiler): ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.ccompiler
from typing import Any, Callable, List, Optional, Tuple, Union
_Macro = Union[Tuple[str], Tuple[str, Optional[str]]]

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.cmd
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.core
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.cygwinccompiler
from distutils.unixccompiler import UnixCCompiler
class CygwinCCompiler(UnixCCompiler): ...

View File

@@ -1,3 +1 @@
# Stubs for distutils.debug
DEBUG: bool

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.dep_util
from typing import List, Tuple
def newer(source: str, target: str) -> bool: ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.dir_util
from typing import List
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ...

View File

@@ -1,4 +1,3 @@
# Stubs for distutils.dist
from distutils.cmd import Command
from typing import Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type

View File

@@ -1,5 +1,3 @@
# Stubs for emxccompiler
from distutils.unixccompiler import UnixCCompiler
class EMXCCompiler(UnixCCompiler): ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.fancy_getopt
from typing import Any, List, Mapping, Optional, Tuple, Union, overload
_Option = Tuple[str, Optional[str], str]

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.file_util
from typing import Optional, Sequence, Tuple
def copy_file(

View File

@@ -1,3 +1 @@
# Stubs for distutils.filelist
class FileList: ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.msvccompiler
from distutils.ccompiler import CCompiler
class MSVCCompiler(CCompiler): ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.spawn
from typing import List, Optional
def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.sysconfig
from distutils.ccompiler import CCompiler
from typing import Mapping, Optional, Union

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.text_file
from typing import IO, List, Optional, Tuple, Union
class TextFile:

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.unixccompiler
from distutils.ccompiler import CCompiler
class UnixCCompiler(CCompiler): ...

View File

@@ -1,5 +1,3 @@
# Stubs for distutils.util
from typing import Any, Callable, List, Mapping, Optional, Tuple
def get_platform() -> str: ...

View File

@@ -1,5 +1,3 @@
# Stubs for email.mime.application
from email.mime.nonmultipart import MIMENonMultipart
from typing import Callable, Optional, Tuple, Union

View File

@@ -1,7 +1,3 @@
# Stubs for functools (Python 2.7)
# NOTE: These are incomplete!
from abc import ABCMeta, abstractmethod
from typing import Any, Callable, Dict, Generic, Iterable, Optional, Sequence, Tuple, Type, TypeVar, overload

View File

@@ -1,5 +1,3 @@
# Stubs for gc
from typing import Any, List, Tuple
def enable() -> None: ...

View File

@@ -1,5 +1,3 @@
# Stubs for getpass (Python 2)
from typing import IO, Any
class GetPassWarning(UserWarning): ...

View File

@@ -1,5 +1,3 @@
# Stubs for hashlib (Python 2)
from typing import Tuple, Union
_DataType = Union[str, unicode, bytearray, buffer, memoryview]

View File

@@ -1,8 +1,3 @@
# Stubs for httplib (Python 2)
#
# Generated by stubgen and manually massaged a bit.
# Needs lots more work!
import mimetools
import ssl
from typing import Any, Dict, Optional, Protocol

View File

@@ -1,5 +1,3 @@
"""Stubs for the 'imp' module."""
import types
from typing import IO, Any, Iterable, List, Optional, Tuple

View File

@@ -1,9 +1,3 @@
# Stubs for io
# Based on https://docs.python.org/2/library/io.html
# Only a subset of functionality is included.
from typing import IO, Any, Union
import _io

View File

@@ -1,7 +1,3 @@
# Stubs for itertools
# Based on https://docs.python.org/2/library/itertools.html
from typing import Any, Callable, Generic, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload
_T = TypeVar("_T")

View File

@@ -1,5 +1,3 @@
# Stubs for Python 2.7 md5 stdlib module
from hashlib import md5 as md5
new = md5

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/mutex.py
from typing import Any, Callable, Deque, TypeVar
_ArgType = TypeVar("_ArgType")

View File

@@ -1,4 +1,3 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath

View File

@@ -1,4 +1,3 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath

View File

@@ -1,7 +1,3 @@
# Stubs for platform (Python 2)
#
# Based on stub generated by stubgen.
from typing import Any, Optional, Tuple
__copyright__: Any

View File

@@ -1,11 +1,3 @@
# Stubs for random
# Ron Murawski <ron@horizonchess.com>
# Updated by Jukka Lehtosalo
# based on https://docs.python.org/2/library/random.html
# ----- random classes -----
import _random
from typing import AbstractSet, Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, Union, overload

View File

@@ -1,9 +1,3 @@
# Stubs for re
# Ron Murawski <ron@horizonchess.com>
# 'bytes' support added by Jukka Lehtosalo
# based on: http: //docs.python.org/2.7/library/re.html
from typing import (
Any,
AnyStr,

View File

@@ -1,7 +1,3 @@
# Stubs for rfc822 (Python 2)
#
# Based on stub generated by stubgen.
from typing import Any, Optional
class Message:

View File

@@ -1,4 +1,3 @@
# Stubs for sets (Python 2)
from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union
_T = TypeVar("_T")

View File

@@ -1,5 +1,3 @@
# Stubs for Python 2.7 sha stdlib module
class sha(object):
def update(self, arg: str) -> None: ...
def digest(self) -> str: ...

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_constants.py
from typing import Dict, List, TypeVar
MAGIC: int

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_parse.py
from typing import Any, Dict, Iterable, List, Match, Optional, Pattern as _Pattern, Set, Tuple, Union
SPECIAL_CHARS: str

View File

@@ -1,7 +1,3 @@
# Stubs for string
# Based on http://docs.python.org/3.2/library/string.html
from typing import Any, AnyStr, Iterable, List, Mapping, Optional, Sequence, Text, Tuple, Union, overload
ascii_letters: str

View File

@@ -1,4 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/stringold.py
from typing import AnyStr, Iterable, List, Optional, Type
whitespace: str

View File

@@ -1,5 +1,3 @@
"""Stub file for the 'strop' module."""
from typing import List, Sequence
lowercase: str

View File

@@ -1,7 +1,3 @@
# Stubs for subprocess
# Based on http://docs.python.org/2/library/subprocess.html and Python 3 stub
from typing import IO, Any, Callable, Generic, List, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union
_FILE = Union[None, int, IO[Any]]

View File

@@ -1,5 +1,3 @@
# Stubs for symbol (Python 2)
from typing import Dict
single_input: int

View File

@@ -1,5 +1,3 @@
"""Stubs for the 'sys' module."""
from types import ClassType, FrameType, ModuleType, TracebackType
from typing import IO, Any, BinaryIO, Callable, Dict, List, NoReturn, Optional, Sequence, Text, Tuple, Type, Union, overload

View File

@@ -1,4 +1,3 @@
"""Stubs for the "thread" module."""
from typing import Any, Callable
def _count() -> int: ...

View File

@@ -1,6 +1,3 @@
# Stubs for toaiff (Python 2)
# Source: https://hg.python.org/cpython/file/2.7/Lib/toaiff.py
from pipes import Template
from typing import Dict, List

View File

@@ -1,5 +1,3 @@
# Automatically generated by pytype, manually fixed up. May still contain errors.
from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Tuple, Union
__author__: str

View File

@@ -1,10 +1,9 @@
# Stubs for types
# Note, all classes "defined" here require special handling.
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, overload
_T = TypeVar("_T")
# Note, all classes "defined" here require special handling.
class NoneType: ...
TypeType = type

View File

@@ -1,5 +1,3 @@
# Stubs for typing (Python 2.7)
import collections # Needed by aliases like DefaultDict, see mypy issue 2986
from abc import ABCMeta, abstractmethod
from types import CodeType, FrameType, TracebackType

View File

@@ -1,7 +1,3 @@
# Stubs for unittest
# Based on http://docs.python.org/2.7/library/unittest.html
import datetime
import types
from abc import ABCMeta, abstractmethod

View File

@@ -1,5 +1,3 @@
# Stubs for urlparse (Python 2)
from typing import AnyStr, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union, overload
_String = Union[str, unicode]

View File

@@ -1,7 +1,3 @@
# Stubs for user (Python 2)
# Docs: https://docs.python.org/2/library/user.html
# Source: https://hg.python.org/cpython/file/2.7/Lib/user.py
from typing import Any
def __getattr__(name) -> Any: ...

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/whichdb.py
from typing import Optional, Text
def whichdb(filename: Text) -> Optional[str]: ...

View File

@@ -1,5 +1,3 @@
# Stubs for xmlrpclib (Python 2)
from datetime import datetime
from gzip import GzipFile
from httplib import HTTPConnection, HTTPResponse, HTTPSConnection

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_bisect' module."""
from typing import MutableSequence, Optional, Sequence, TypeVar
_T = TypeVar("_T")

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_codecs' module."""
import codecs
import sys
from typing import Any, Callable, Dict, Optional, Text, Tuple, Union

View File

@@ -1,5 +1,3 @@
"""Stub file for the '_heapq' module."""
import sys
from typing import Any, Callable, Iterable, List, Optional, TypeVar

View File

@@ -1,5 +1,3 @@
# Stubs for _random
import sys
from typing import Tuple

View File

@@ -1,7 +1,3 @@
# Stubs for array
# Based on http://docs.python.org/3.6/library/array.html
import sys
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing_extensions import Literal

View File

@@ -1,5 +1,3 @@
# Stubs for base64
import sys
from typing import IO, Optional, Union

View File

@@ -1,7 +1,3 @@
# Stubs for binascii
# Based on http://docs.python.org/3.2/library/binascii.html
import sys
from typing import Text, Union

View File

@@ -1,4 +1,3 @@
# Stubs for bisect
from _bisect import *
bisect = bisect_right

View File

@@ -1,6 +1,3 @@
# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/chunk.py
# Source(py3): https://github.com/python/cpython/blob/master/Lib/chunk.py
from typing import IO
class Chunk:

View File

@@ -1,5 +1,3 @@
"""Stub file for the 'cmath' module."""
import sys
from typing import SupportsComplex, SupportsFloat, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for cmd (Python 2/3)
from typing import IO, Any, Callable, List, Optional, Tuple
class Cmd:

View File

@@ -1,5 +1,3 @@
# Stubs for code
import sys
from types import CodeType
from typing import Any, Callable, Mapping, Optional

View File

@@ -1,6 +1,3 @@
# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py
# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py
from types import CodeType
from typing import Optional

View File

@@ -1,5 +1,3 @@
# Stubs for colorsys
from typing import Tuple
def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ...

View File

@@ -1,5 +1,3 @@
# Stubs for copy
from typing import Any, Dict, Optional, TypeVar
_T = TypeVar("_T")

View File

@@ -1,5 +1,3 @@
# Stubs for ctypes
import sys
from array import array
from typing import (

View File

@@ -1,5 +1,3 @@
# Stubs for ctypes.util
import sys
from typing import Optional

View File

@@ -1,5 +1,3 @@
# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html
import sys
from typing import (
Any,

View File

@@ -1,5 +1,3 @@
# Stubs for errno
from typing import Mapping
errorcode: Mapping[int, str]

View File

@@ -1,4 +1,3 @@
# Stubs for filecmp (Python 2/3)
import sys
from typing import Any, AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py
# and https://github.com/python/cpython/blob/master/Lib/formatter.py
from typing import IO, Any, Iterable, List, Optional, Tuple
AS_IS: None

View File

@@ -1,9 +1,3 @@
# Stubs for fractions
# See https://docs.python.org/3/library/fractions.html
#
# Note: these stubs are incomplete. The more complex type
# signatures are currently omitted. Also see numbers.pyi.
import sys
from decimal import Decimal
from numbers import Integral, Rational, Real

View File

@@ -1,5 +1,3 @@
# Stubs for hmac
import sys
from _typeshed import ReadableBuffer
from types import ModuleType

View File

@@ -1 +0,0 @@
# Stubs for lib2to3 (Python 3.6)

View File

@@ -1,5 +1,3 @@
# Stubs for lib2to3.pgen2.literals (Python 3.6)
from typing import Dict, Match, Text
simple_escapes: Dict[Text, Text]

View File

@@ -1,5 +1,3 @@
# Stubs for lib2to3.pgen2.parse (Python 3.6)
from lib2to3.pgen2.grammar import _DFAS, Grammar
from lib2to3.pytree import _NL, _Convert, _RawNode
from typing import Any, List, Optional, Sequence, Set, Text, Tuple

View File

@@ -1,5 +1,3 @@
# Stubs for lib2to3.pgen2.token (Python 3.6)
import sys
from typing import Dict, Text

View File

@@ -1,6 +1,3 @@
# Stubs for lib2to3.pgen2.tokenize (Python 3.6)
# NOTE: Only elements from __all__ are present.
from lib2to3.pgen2.token import * # noqa
from typing import Callable, Iterable, Iterator, List, Text, Tuple

Some files were not shown because too many files have changed in this diff Show More