Drop support for Python 3.6, part 1 (#8250)

* Document that typeshed support 3.7+.
* Don't run tests on Python 3.6.
* Remove Python 3.6 allow lists.
* Merge common allowlist items.

Part of #6189
This commit is contained in:
Sebastian Rittau
2022-07-07 14:42:02 +02:00
committed by GitHub
parent 9ccf4589a0
commit 9a5c865034
27 changed files with 52 additions and 411 deletions

View File

@@ -21,7 +21,7 @@ jobs:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false
steps:
@@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests.txt) termcolor
- name: Install apt packages

View File

@@ -27,7 +27,7 @@ jobs:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false
steps:

View File

@@ -66,7 +66,7 @@ jobs:
strategy:
matrix:
platform: ["linux", "win32", "darwin"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v3
@@ -82,7 +82,7 @@ jobs:
strategy:
matrix:
python-platform: ["Linux", "Windows", "Darwin"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
env:
PYRIGHT_VERSION: 1.1.255 # Must match pyright_test.py.
@@ -112,7 +112,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"
- name: Install dependencies
run: pip install $(grep tomli== requirements-tests.txt) termcolor
- name: Run stubtest

View File

@@ -17,7 +17,7 @@ contributors can be found in [CONTRIBUTING.md](CONTRIBUTING.md). **Please read
it before submitting pull requests; do not report issues with annotations to
the project the stubs are for, but instead report them here to typeshed.**
Typeshed supports Python versions 2.7 and 3.6 and up.
Typeshed supports Python versions 2.7 and 3.7 and up.
## Using

View File

@@ -28,7 +28,7 @@ from typing_extensions import Annotated, TypeAlias
import tomli
from colors import colored, print_error, print_success_msg
SUPPORTED_VERSIONS = [(3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6), (2, 7)]
SUPPORTED_VERSIONS = [(3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (2, 7)]
SUPPORTED_PLATFORMS = frozenset({"linux", "win32", "darwin"})
TYPESHED_DIRECTORIES = frozenset({"stdlib", "stubs", "tests", "test_cases", "scripts"})

View File

@@ -1,4 +1,3 @@
_?curses.A_ITALIC
_?curses.color_pair
webbrowser.MacOSXOSAScript.__init__
distutils.util.__warningregistry__

View File

@@ -1,4 +1,3 @@
_?curses.A_ITALIC
_?curses.color_pair
xxlimited.Xxo.x_exports
distutils.util.__warningregistry__

View File

@@ -1,20 +0,0 @@
ctypes.wintypes
pwd.getpwnam
webbrowser.MacOSXOSAScript.__init__
# Exists at runtime, but missing from stubs
posix.stat_float_times
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
uuid.lib
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
ssl.PROTOCOL_SSLv3 # Depends on openssl compilation
ssl.RAND_egd # Depends on openssl compilation

View File

@@ -1,4 +1,3 @@
_?curses.A_ITALIC
ctypes.wintypes
pwd.getpwnam
webbrowser.MacOSXOSAScript.__init__

View File

@@ -1,4 +1,3 @@
_?curses.A_ITALIC
webbrowser.MacOSXOSAScript.__init__
# ==========

View File

@@ -1,4 +1,3 @@
_?curses.A_ITALIC
webbrowser.MacOSXOSAScript.__init__
# ==========

View File

@@ -1,3 +1,5 @@
_?curses.A_ITALIC
_posixsubprocess.cloexec_pipe
os.EX_NOTFOUND
os.SF_MNOWAIT

View File

@@ -1,17 +0,0 @@
ctypes.wintypes
pwd.getpwnam
# Exists at runtime, but missing from stubs
posix.stat_float_times
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
uuid.lib
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
ssl.PROTOCOL_SSLv3 # Depends on openssl compilation
ssl.RAND_egd # Depends on openssl compilation

View File

@@ -9,17 +9,14 @@ _collections_abc.ValuesView.__reversed__
_weakref.ProxyType.__reversed__ # Doesn't really exist
asyncio.Future.__init__ # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
builtins.dict.get
builtins.float.__setformat__ # Internal method for CPython test suite
builtins.property.__set_name__ # Doesn't actually exist
contextlib.AbstractAsyncContextManager.__class_getitem__
contextlib.AbstractContextManager.__class_getitem__
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
gettext.install
gettext.translation
hmac.new # Stub is a white lie; see comments in the stub
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
ipaddress.IPv4Interface.hostmask
ipaddress.IPv6Interface.hostmask
ipaddress._BaseNetwork.broadcast_address
@@ -31,7 +28,6 @@ platform.uname_result.__match_args__
platform.uname_result.__new__
platform.uname_result._fields
platform.uname_result.processor
re.Pattern.scanner # Undocumented and not useful. #6405
sys.UnraisableHookArgs # Not exported from sys
tkinter.Tk.split
types.GenericAlias.__getattr__
@@ -39,7 +35,6 @@ types.GenericAlias.__mro_entries__
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
typing._SpecialForm.__mro_entries__
typing.ForwardRef._evaluate
typing._SpecialForm.__init__
typing._TypedDict.__delitem__
typing._TypedDict.__ior__
typing._TypedDict.__or__
@@ -76,9 +71,6 @@ _csv.Reader
_csv.Writer
asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this
bdb.Breakpoint.clearBreakpoints
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.util.get_host_platform
functools.partial.__vectorcalloffset__ # undocumented implementation detail
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
@@ -89,7 +81,6 @@ multiprocessing.managers.SharedMemoryServer.public
multiprocessing.managers.SharedMemoryServer.release_segment
multiprocessing.managers.SharedMemoryServer.shutdown
multiprocessing.managers.SharedMemoryServer.track_segment
typing._SpecialForm.__call__
# ==========
# Related to positional-only arguments
@@ -152,7 +143,6 @@ ast.Index.__new__
ast.NameConstant.__new__
ast.Num.__new__
ast.Str.__new__
contextvars.Context.__init__
queue.SimpleQueue.__init__
xml.etree.ElementTree.XMLParser.__init__
xml.etree.cElementTree.XMLParser.__init__
@@ -172,21 +162,9 @@ typing.SupportsRound.__init__
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
_ast.ImportFrom.level # None on the class, but never None on instances
ast.ImportFrom.level # None on the class, but never None on instances
# These enums derive from (str, Enum). See comment in py3_common.txt
pstats.SortKey.__new__
tkinter.EventType.__new__
# White lies around defaults
dataclasses.field
dataclasses.KW_ONLY
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__

View File

@@ -16,15 +16,9 @@ _operator.attrgetter.__vectorcalloffset__
_operator.itemgetter.__vectorcalloffset__
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group
asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this
builtins.dict.get
configparser.LegacyInterpolation.__init__
contextvars.Context.__init__
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.util.get_host_platform
enum.Enum.__init__
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
ftplib.FTP.trust_server_pasv_ipv4_address
functools.partial.__vectorcalloffset__
@@ -107,9 +101,7 @@ builtins.property.__set_name__ # Doesn't actually exist
enum.StrEnum.value # read-only property at runtime but too magical for stubtest
hmac.new # Stub is a white lie; see comments in the stub
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
pickle.Pickler.reducer_override # implemented in C pickler
re.Pattern.scanner # Undocumented and not useful. #6405
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
@@ -152,24 +144,16 @@ xml.etree.ElementTree.XMLParser.__init__
xml.etree.cElementTree.XMLParser.__init__
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
_ast.ImportFrom.level # None on the class, but never None on instances
ast.ImportFrom.level # None on the class, but never None on instances
# These enums derive from (str, Enum). See comment in py3_common.txt
pstats.SortKey.__new__
tkinter.EventType.__new__
# Treated an alias of a typing class in the stubs,
# they are generic to type checkers anyway.
contextlib.AbstractAsyncContextManager.__class_getitem__
contextlib.AbstractContextManager.__class_getitem__
# Super-special typing primitives
typing._SpecialForm.__call__
typing._SpecialForm.__init__
typing._SpecialForm.__mro_entries__
typing._TypedDict.__delitem__
typing._TypedDict.__ior__
@@ -184,7 +168,6 @@ typing._TypedDict.values
# White lies around defaults
dataclasses.KW_ONLY
dataclasses.field
# https://github.com/python/mypy/issues/12819 (... in runtime default)
wsgiref.types.InputStream.read
@@ -198,8 +181,3 @@ wsgiref.types.WSGIApplication
# Really it's mad about dict.get
wsgiref.types.WSGIEnvironment.get
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__

View File

@@ -1,182 +0,0 @@
_collections_abc.AsyncGenerator.ag_await
_collections_abc.AsyncGenerator.ag_code
_collections_abc.AsyncGenerator.ag_frame
_collections_abc.AsyncGenerator.ag_running
_dummy_threading
asyncio.Future.__init__ # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
asyncio.futures._TracebackLogger.__init__
asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omitted from the stub
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
builtins.float.__setformat__ # Internal method for CPython test suite
builtins.str.maketrans
cmath.log
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.AsyncGenerator.ag_await
collections.AsyncGenerator.ag_code
collections.AsyncGenerator.ag_frame
collections.AsyncGenerator.ag_running
collections.Callable
collections.Mapping.__reversed__ # Set to None at runtime for a better error message
collections.UserString.maketrans
datetime.datetime_CAPI
distutils.command.bdist_wininst # see #6523
distutils.cygwinccompiler.RE_VERSION
distutils.dist.command_re
distutils.fancy_getopt.longopt_re
distutils.fancy_getopt.neg_alias_re
dummy_threading.Condition.acquire
dummy_threading.Condition.release
dummy_threading.Event.isSet
dummy_threading.local.__new__
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
hmac.HMAC.__init__
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function # Removed in 3.11, can add if someone needs this
io.StringIO.readline
ipaddress._BaseNetwork.__init__
json.loads
mmap.ACCESS_DEFAULT
(os|posix).utime
pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
random.Random.randrange # missing undocumented arg _int
sched.Event.__doc__ # __slots__ is overridden
stringprep.unicodedata # re-exported from unicodedata
sre_compile.dis
typing.AsyncGenerator.ag_await
typing.AsyncGenerator.ag_code
typing.AsyncGenerator.ag_frame
typing.AsyncGenerator.ag_running
typing.ChainMap.fromkeys
typing.Coroutine.cr_await
typing.Coroutine.cr_code
typing.Coroutine.cr_frame
typing.Coroutine.cr_running
typing.Generator.gi_code
typing.Generator.gi_frame
typing.Generator.gi_running
typing.Generator.gi_yieldfrom
typing.IO.closed # Incorrect definition in CPython, fixed in bpo-39493
typing.Mapping.get
typing.NamedTuple._asdict
typing.NamedTuple._make
typing.NamedTuple._replace
typing.Sequence.index
typing.Text.maketrans
typing.runtime_checkable
typing\.\w+\.__new__
uuid.UUID.int
uuid.libname
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
xml.parsers.expat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt
tkinter.EventType.__new__
tkinter.commondialog.[A-Z_]+
tkinter.commondialog.TclVersion
tkinter.commondialog.TkVersion
tkinter.commondialog.wantobjects
tkinter.dialog.[A-Z_]+
tkinter.dialog.TclVersion
tkinter.dialog.TkVersion
tkinter.dialog.wantobjects
tkinter.filedialog.[A-Z_]+
tkinter.filedialog.TclVersion
tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
typing.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491
typing.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491
sqlite3.OptimizedUnicode.maketrans
sqlite3.dbapi2.OptimizedUnicode.maketrans
collections.Coroutine.cr_await
collections.Coroutine.cr_code
collections.Coroutine.cr_frame
collections.Coroutine.cr_running
collections.Generator.gi_code
collections.Generator.gi_frame
collections.Generator.gi_running
collections.Generator.gi_yieldfrom
collections.Mapping.get # Adding None to the Union messed up mypy
collections.Sequence.index # Supporting None in end is not mandatory
# SpooledTemporaryFile implements IO except these methods before Python 3.11
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
tempfile.SpooledTemporaryFile.readable
tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable
# Exists at runtime, but missing from stubs
_bisect.bisect
_bisect.insort
asyncio.futures._TracebackLogger.loop
asyncio.futures._TracebackLogger.source_traceback
calendar.HTMLCalendar.cssclasses
distutils.cmd.install_misc
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
dummy_threading.Lock
dummy_threading.RLock
dummy_threading.stack_size
html.parser.HTMLParser.unescape
platform.popen
plistlib.Data.asBase64
plistlib.Data.fromBase64
ssl.SSLObject.verify_client_post_handshake
ssl.SSLSocket.verify_client_post_handshake
tempfile.SpooledTemporaryFile.softspace
tkinter.Tk.split
tkinter.dnd.Icon
tkinter.dnd.Tester
tkinter.dnd.test
typing.[A-Z]\w*.__.*__ # many missing typing dunders in py36
xml.dom.xmlbuilder.DocumentLS.async
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
# Intentionally omitted because of syntax issues
asyncio.async
asyncio.tasks.async
# Side effects from module initialization
_compat_pickle.excname
email.contentmanager.maintype
email.contentmanager.subtype
inspect.k
inspect.mod_dict
inspect.v
json.encoder.i
lib2to3.pgen2.grammar.line
lib2to3.pgen2.grammar.name
lib2to3.pgen2.grammar.op
pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
collections.Set.__rand__
collections.Set.__ror__
collections.Set.__rsub__
collections.Set.__rxor__
builtins.memoryview.__iter__ # C type that implements __getitem__
builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only
sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__
sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only
sqlite3.Binary.__iter__ # C type that implements __getitem__
sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only
pyexpat.XMLParserType.intern # does exist but stubtest can't see it (https://github.com/python/cpython/blob/3.7/Modules/pyexpat.c#L1322)
xml.parsers.expat.XMLParserType.intern # does exist but stubtest can't see it (https://github.com/python/cpython/blob/3.7/Modules/pyexpat.c#L1322)

View File

@@ -11,7 +11,6 @@ asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omit
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
builtins.dict.get
builtins.float.__set_format__ # Internal method for CPython test suite
builtins.str.maketrans
cmath.log
@@ -32,24 +31,18 @@ dummy_threading.Condition.acquire
dummy_threading.Condition.release
dummy_threading.Event.isSet
dummy_threading.local.__new__
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
hmac.HMAC.__init__
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function # Removed in 3.11, can add if someone needs this
ipaddress._BaseNetwork.__init__
json.loads
(os|posix).utime
random.Random.randrange # missing undocumented arg _int
re.Pattern.scanner # Undocumented and not useful. #6405
sched.Event.__doc__ # __slots__ is overridden
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
typing.NamedTuple._asdict
typing.NamedTuple._make
typing.NamedTuple._replace
typing._SpecialForm.__init__
typing._SpecialForm.__new__
typing.runtime_checkable
typing.Text.maketrans
@@ -58,9 +51,6 @@ uuid.UUID.is_safe
uuid.getnode # undocumented, unused parameter getters that was later removed
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt
pstats.SortKey.__new__
tkinter.EventType.__new__
sqlite3.OptimizedUnicode.maketrans
sqlite3.dbapi2.OptimizedUnicode.maketrans
@@ -86,9 +76,6 @@ tempfile.SpooledTemporaryFile.writable
# Exists at runtime, but missing from stubs
contextvars.ContextVar.__class_getitem__
datetime.datetime_CAPI
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.cygwinccompiler.RE_VERSION
@@ -126,7 +113,6 @@ tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
typing._SpecialForm.__call__
# ==========
# Allowlist entries that cannot or should not be fixed
@@ -161,18 +147,9 @@ sqlite3.Binary.__iter__ # C type that implements __getitem__
sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only
# C signature is broader than what is actually accepted
contextvars.Context.__init__
queue.SimpleQueue.__init__
pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
xml.parsers.expat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
pyexpat.XMLParserType.intern # does exist but stubtest can't see it (https://github.com/python/cpython/blob/3.7/Modules/pyexpat.c#L1322)
xml.parsers.expat.XMLParserType.intern # does exist but stubtest can't see it (https://github.com/python/cpython/blob/3.7/Modules/pyexpat.c#L1322)
# White lies around defaults
dataclasses.field
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__

View File

@@ -17,7 +17,6 @@ asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omit
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
builtins.dict.get
builtins.float.__set_format__ # Internal method for CPython test suite
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
@@ -38,13 +37,11 @@ dummy_threading.Condition.release
dummy_threading.Event.isSet
dummy_threading.Thread.native_id
dummy_threading.local.__new__
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
gettext.install # codeset default value is ['unspecified'] so can't be specified
gettext.translation # codeset default value is ['unspecified'] so can't be specified
hmac.new # Stub is a white lie; see comments in the stub
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function # Removed in 3.11, can add if someone needs this
ipaddress.IPv4Interface.hostmask
@@ -54,10 +51,7 @@ ipaddress._BaseNetwork.hostmask
multiprocessing.spawn._main
pickle.Pickler.reducer_override # implemented in C pickler
random.Random.randrange # missing undocumented arg _int
re.Pattern.scanner # Undocumented and not useful. #6405
sched.Event.__doc__ # __slots__ is overridden
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
sys.UnraisableHookArgs # Not exported from sys
typing.NamedTuple.__new__
typing.NamedTuple._asdict
@@ -70,16 +64,12 @@ typing.SupportsFloat.__init__
typing.SupportsIndex.__init__
typing.SupportsInt.__init__
typing.SupportsRound.__init__
typing._SpecialForm.__init__
typing._SpecialForm.__new__
weakref.WeakValueDictionary.update
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signature
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature
# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt
pstats.SortKey.__new__
tkinter.EventType.__new__
collections.Coroutine.cr_await
collections.Coroutine.cr_code
@@ -102,9 +92,6 @@ tempfile.SpooledTemporaryFile.writable
# Exists at runtime, but missing from stubs
contextvars.ContextVar.__class_getitem__
datetime.datetime_CAPI
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.util.get_host_platform
@@ -145,7 +132,6 @@ tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
typing._SpecialForm.__call__
# ==========
# Allowlist entries that cannot or should not be fixed
@@ -180,16 +166,7 @@ sqlite3.Binary.__iter__ # C type that implements __getitem__
sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only
# C signature is broader than what is actually accepted
contextvars.Context.__init__
queue.SimpleQueue.__init__
uuid.getnode # undocumented, unused parameter getters that was later removed
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
# White lies around defaults
dataclasses.field
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__

View File

@@ -15,7 +15,6 @@ ast.Num.__new__
ast.Str.__new__
asyncio.Future.__init__ # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
builtins.dict.get
builtins.float.__setformat__ # Internal method for CPython test suite
collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491
@@ -33,12 +32,10 @@ collections.ValuesView.__reversed__
contextlib.AbstractAsyncContextManager.__class_getitem__
contextlib.AbstractContextManager.__class_getitem__
distutils.command.bdist_wininst # see #6523
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
gettext.install
gettext.translation
hmac.new # Stub is a white lie; see comments in the stub
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function # Removed in 3.11, can add if someone needs this
@@ -52,10 +49,7 @@ pickle.Pickler.reducer_override # implemented in C pickler
platform.uname_result.__new__
platform.uname_result._fields
platform.uname_result.processor
re.Pattern.scanner # Undocumented and not useful. #6405
sched.Event.__doc__ # __slots__ is overridden
ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
sys.UnraisableHookArgs # Not exported from sys
tkinter.Tk.split
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
@@ -69,7 +63,6 @@ typing.SupportsFloat.__init__
typing.SupportsIndex.__init__
typing.SupportsInt.__init__
typing.SupportsRound.__init__
typing._SpecialForm.__init__
typing._TypedDict.__delitem__
typing._TypedDict.__ior__
typing._TypedDict.__or__
@@ -83,10 +76,6 @@ typing._TypedDict.values
weakref.ProxyType.__reversed__ # Doesn't really exist
weakref.WeakValueDictionary.update
# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt
pstats.SortKey.__new__
tkinter.EventType.__new__
collections.Coroutine.cr_await
collections.Coroutine.cr_code
collections.Coroutine.cr_frame
@@ -109,9 +98,6 @@ collections.Awaitable.__class_getitem__
collections.Container.__class_getitem__
collections.Iterable.__class_getitem__
collections.MappingView.__class_getitem__
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.util.get_host_platform
@@ -130,7 +116,6 @@ multiprocessing.managers.SharedMemoryServer.shutdown
multiprocessing.managers.SharedMemoryServer.track_segment
stringprep.unicodedata # re-exported from unicodedata
types.GenericAlias.__mro_entries__
typing._SpecialForm.__call__
typing._SpecialForm.__mro_entries__
# SpooledTemporaryFile implements IO except these methods before Python 3.11
@@ -173,7 +158,6 @@ sqlite3.Binary.__iter__ # C type that implements __getitem__
sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only
# C signature is broader than what is actually accepted
contextvars.Context.__init__
queue.SimpleQueue.__init__
xml.etree.ElementTree.XMLParser.__init__
xml.etree.cElementTree.XMLParser.__init__
@@ -185,11 +169,3 @@ ast.ImportFrom.level # None on the class, but never None on instances
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
# White lies around defaults
dataclasses.field
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__

View File

@@ -46,6 +46,7 @@ asyncio.locks.Condition.locked
asyncio.locks.Condition.release
asyncio.proactor_events.BaseProactorEventLoop.sock_recv # nbytes parameter has different name 'n' in implementation
asyncio.selector_events.BaseSelectorEventLoop.sock_recv # nbytes parameter has different name 'n' in implementation
builtins.dict.get
builtins.ellipsis # type is not exposed anywhere
builtins.function
builtins.memoryview.__contains__ # C type that implements __getitem__
@@ -90,19 +91,12 @@ ctypes.wstring_at # docstring argument name is wrong
distutils.command.bdist_packager # It exists in docs as package name but not in code except as a mention in a comment.
distutils.version.Version._cmp # class should have declared this
distutils.version.Version.parse # class should have declared this
# Enum `name` and `value` are special properties that exists at runtime, but stubtest can't detect
# https://github.com/python/typeshed/pull/6576#issuecomment-992538677
enum.Enum.name
enum.Enum.value
enum.Flag.name
enum.Flag.value
enum.IntEnum.value
enum.Enum._generate_next_value_
hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
http.HTTPStatus.description # set in __new__
http.HTTPStatus.phrase # set in __new__
http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta
imaplib.IMAP4_SSL.ssl # Dependent on SSL existence
importlib.abc.FileLoader.get_filename # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.FileLoader.load_module # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
@@ -176,7 +170,6 @@ socketserver.BaseServer.RequestHandlerClass # is defined as a property, because
socketserver.BaseServer.fileno # implemented in derived classes
socketserver.BaseServer.get_request # implemented in derived classes
socketserver.BaseServer.server_bind # implemented in derived classes
ssl.PROTOCOL_SSLv2 # Defined only if compiled with ssl v2
ssl.Purpose.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
ssl._ASN1Object.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
sys.implementation # Actually SimpleNamespace but then you wouldn't have convenient attributes
@@ -384,6 +377,18 @@ builtins.super.__self__
builtins.super.__self_class__
builtins.super.__thisclass__
# Enum `name` and `value` are special properties that exists at runtime, but stubtest can't detect
# https://github.com/python/typeshed/pull/6576#issuecomment-992538677
enum.Enum.name
enum.Enum.value
enum.Flag.name
enum.Flag.value
enum.IntEnum.value
# These enums derive from (int, IntEnum) or (str, Enum).
pstats.SortKey.__new__
tkinter.EventType.__new__
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
# But have more precise (accurate) signatures in the stub
multiprocessing.managers.BaseListProxy.__imul__
@@ -400,6 +405,12 @@ multiprocessing.managers.DictProxy.keys
multiprocessing.managers.DictProxy.popitem
multiprocessing.managers.DictProxy.values
# Items that depend on the existence and flags of SSL
imaplib.IMAP4_SSL.ssl
ssl.PROTOCOL_SSLv2
ssl.PROTOCOL_SSLv3
ssl.RAND_egd
# GetSetDescriptor that always raises AttributeError
builtins.OSError.characters_written
# Aliases for OSError
@@ -414,18 +425,23 @@ socket.error.characters_written
collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there
distutils.command.check.SilentReporter # only defined if docutils in installed
hmac.HMAC.blocksize # use block_size instead
http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded
pickle.Pickler.memo # undocumented implementation detail, has different type in C/Python implementations
pickle.Unpickler.memo # undocumented implementation detail, has different type in C/Python implementations
re.Pattern.scanner # Undocumented and not useful. #6405
tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.FunctionType.__get__
types.LambdaType.__get__
builtins.classmethod.__get__
builtins.property.__get__
builtins.staticmethod.__get__
types.ClassMethodDescriptorType.__get__
types.FunctionType.__get__
types.GetSetDescriptorType.__get__
types.LambdaType.__get__
types.MemberDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__
# Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined.
typing.[A-Z]\w+
@@ -434,15 +450,23 @@ typing_extensions\..*
# Typing-related weirdness
_collections_abc.Callable
_typeshed.* # Utility types for typeshed, doesn't exist at runtime
typing._SpecialForm.__call__
typing._SpecialForm.__init__
# Builtins that type checkers pretends exist
builtins.reveal_locals
builtins.reveal_type
# White lies around defaults
dataclasses.field
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
inspect.Parameter.__init__
inspect.Signature.__init__
# C signature is broader than what is actually accepted
contextvars.Context.__init__
multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ # Any field can be set on Namespace
# sys attributes that are not always defined
@@ -707,6 +731,9 @@ distutils.dist.Distribution.print_commands
distutils.dist.Distribution.reinitialize_command
distutils.dist.Distribution.run_command
distutils.dist.Distribution.run_commands
distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.dist.fix_help_options
distutils.extension.read_setup_file
distutils.fancy_getopt.WS_TRANS

View File

@@ -10,12 +10,3 @@ asyncio.windows_events.IocpProactor.sendto
distutils.command.build_ext.__warningregistry__
msvcrt.GetErrorMode
subprocess.STARTUPINFO.copy
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount

View File

@@ -13,12 +13,3 @@ distutils.command.build_ext.__warningregistry__
msvcrt.GetErrorMode
os.EX_OK
subprocess.STARTUPINFO.copy
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount

View File

@@ -1,23 +0,0 @@
# The following methods were changed in point releases from Python 3.6 to 3.9
# as part of a security fix. These excludes can be removed when the GitHub
# action workflow uses Python versions that include the fix (adding a
# separator argument).
cgi.FieldStorage.__init__
cgi.parse
urllib.parse.parse_qs
urllib.parse.parse_qsl
hashlib.scrypt
os.startfile
# Exists at runtime, but missing from stubs
venv.EnvBuilder.include_binary
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner

View File

@@ -18,5 +18,3 @@ os.startfile
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount

View File

@@ -17,5 +17,3 @@ subprocess.STARTUPINFO.copy
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount

View File

@@ -8,12 +8,3 @@ asyncio.IocpProactor.sendto
asyncio.windows_events.IocpProactor.recvfrom
asyncio.windows_events.IocpProactor.sendto
subprocess.STARTUPINFO.copy
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount

View File

@@ -74,3 +74,7 @@ tty
# pathlib functions that rely on modules that don't exist on Windows
pathlib.Path.owner
pathlib.Path.group
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount