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 @@
"""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

View File

@@ -1,5 +1,3 @@
# Stubs for lib2to3.pygram (Python 3.6)
from lib2to3.pgen2.grammar import Grammar
class Symbols:

View File

@@ -1,5 +1,3 @@
# Stubs for lib2to3.pytree (Python 3.6)
import sys
from lib2to3.pgen2.grammar import Grammar
from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union

View File

@@ -1,5 +1,3 @@
# Stubs for locale
import sys
from decimal import Decimal
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union

View File

@@ -1,6 +1,3 @@
# Stubs for os.path
# Ron Murawski <ron@horizonchess.com>
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath

View File

@@ -1,6 +1,3 @@
# Stubs for math
# See: http://docs.python.org/2/library/math.html
import sys
from typing import Iterable, SupportsFloat, SupportsInt, Tuple, overload

View File

@@ -1,5 +1,3 @@
# Stubs for mimetypes
import sys
from typing import IO, Dict, List, Optional, Sequence, Text, Tuple, Union

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 numbers (Python 3.5)
# See https://docs.python.org/2.7/library/numbers.html
# and https://docs.python.org/3/library/numbers.html
#
# Note: these stubs are incomplete. The more complex type
# signatures are currently omitted.

View File

@@ -1,5 +1,3 @@
# Stubs for operator
import sys
from typing import (
Any,

View File

@@ -1,4 +1,3 @@
# Generated by pytype, with only minor tweaks. Might be incomplete.
import sys
from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type, Union, overload

View File

@@ -1,4 +1,3 @@
# Stubs for pickletools (Python 2 and 3)
import sys
from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union

View File

@@ -1,5 +1,3 @@
# Stubs for poplib (Python 2 and 3)
import socket
import ssl
import sys

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,8 +1,3 @@
# Stubs for pprint
# Based on http://docs.python.org/2/library/pprint.html
# Based on http://docs.python.org/3/library/pprint.html
import sys
from typing import IO, Any, Dict, Optional, Tuple

View File

@@ -1,4 +1,3 @@
# Stubs for pty (Python 2 and 3)
import sys
from typing import Callable, Iterable, Tuple, Union

View File

@@ -1,4 +1,3 @@
# Stubs for py_compile (Python 2 and 3)
import enum
import sys
from typing import AnyStr, List, Optional, Text, Type, Union

View File

@@ -1,5 +1,3 @@
# Stubs for quopri (Python 2 and 3)
from typing import BinaryIO
def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ...

View File

@@ -1,5 +1,3 @@
# Stubs for readline
import sys
from typing import Callable, Optional, Sequence

View File

@@ -1,5 +1,3 @@
# Stubs for rlcompleter
import sys
from typing import Any, Dict, Optional, Union

View File

@@ -1,5 +1,3 @@
# Stubs for site
import sys
from typing import Iterable, List, Optional

View File

@@ -1,4 +1,3 @@
# Stubs for smtpd (Python 2 and 3)
import asynchat
import asyncore
import socket

View File

@@ -1,19 +1,3 @@
"""Stub for the socket module
This file is organized to mirror the module's documentation, with a very small
number of exceptions.
To avoid requiring tests on all platforms, platform checks are included only
where the documentation notes platform availability (as opposed to following
actual availability), with one or two exceptions.
Module documentation: https://docs.python.org/3/library/socket.html
CPython module source: https://github.com/python/cpython/blob/master/Lib/socket.py
CPython C source: https://github.com/python/cpython/blob/master/Modules/socketmodule.c
"""
# Authorship from original mypy stubs (not in typeshed git history):
# Ron Murawski <ron@horizonchess.com>
# adapted for Python 2.7 by Michal Pokorny
import sys
from typing import Any, BinaryIO, Iterable, List, Optional, Sequence, Text, TextIO, Tuple, TypeVar, Union, overload
from typing_extensions import Literal

View File

@@ -1,6 +1,3 @@
# Filip Hron <filip.hron@gmail.com>
# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py
import os
import sys
from datetime import date, datetime, time

View File

@@ -1,6 +1,3 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py
# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py
import sys
from sre_constants import (
SRE_FLAG_DEBUG as SRE_FLAG_DEBUG,

View File

@@ -1,5 +1,3 @@
# Stubs for stringprep (Python 2 and 3)
from typing import Text
def in_table_a1(code: Text) -> bool: ...

View File

@@ -1,8 +1,3 @@
# Stubs for struct
# Based on http://docs.python.org/3.2/library/struct.html
# Based on http://docs.python.org/2/library/struct.html
import sys
from array import array
from mmap import mmap

View File

@@ -1,5 +1,3 @@
# Stubs for sunau (Python 2 and 3)
import sys
from typing import IO, Any, NamedTuple, NoReturn, Optional, Text, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for telnetlib (Python 2 and 3)
import socket
import sys
from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union

View File

@@ -1,6 +1,3 @@
"""Stub file for the 'time' module."""
# See https://docs.python.org/3/library/time.html
import sys
from typing import Any, NamedTuple, Optional, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for timeit (Python 2 and 3)
import sys
from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, Union

View File

@@ -1,5 +1,3 @@
# Stubs for tty (Python 3.6)
from typing import IO, Union
_FD = Union[int, IO[str]]

View File

@@ -1,4 +1,3 @@
# Stubs for uu (Python 2 and 3)
import sys
from typing import BinaryIO, Optional, Text, Union

View File

@@ -1,5 +1,3 @@
# Stubs for uuid
import sys
from typing import Any, Optional, Text, Tuple

View File

@@ -1,5 +1,3 @@
# Stubs for wave (Python 2 and 3)
import sys
from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Optional, Text, Tuple, Union

View File

@@ -1,4 +1,3 @@
# Structs for xdrlib (Python 2 and 3)
from typing import Callable, List, Sequence, TypeVar
_T = TypeVar("_T")

View File

@@ -1,5 +1,3 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
from typing import Callable, Dict, Generator, List, Optional, Pattern, Tuple, TypeVar, Union
from xml.etree.ElementTree import Element

View File

@@ -1,3 +1 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
from xml.etree.ElementTree import * # noqa: F403

View File

@@ -1,5 +1,3 @@
"""Stub file for the 'zipimport' module."""
import os
import sys
from types import CodeType, ModuleType

View File

@@ -1,4 +1,3 @@
# Stubs for zlib
import sys
from array import array
from typing import Any, Union