Remove Python3.8 stubtest allowlists (#13389)

Consolidate remaining allowlists
This commit is contained in:
Sebastian Rittau
2025-01-10 15:17:36 +01:00
committed by GitHub
parent 10ebc999ee
commit f26ad2059e
10 changed files with 32 additions and 632 deletions

View File

@@ -45,6 +45,12 @@ idlelib
# Module members that exist at runtime, but are deliberately missing from stubs
# =============================================================================
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
_collections_abc.Mapping.__reversed__ # set to None at runtime for a better error message
# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
@@ -211,8 +217,11 @@ _?ast.excepthandler.__init__
_?ast.expr.__init__
_?ast.stmt.__init__
_ast.ImportFrom.level # None on the class, but never None on instances
ast.Bytes.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
ast.Ellipsis.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
ast.ImportFrom.level # None on the class, but never None on instances
ast.NameConstant.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
ast.Num.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
ast.Str.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
@@ -253,7 +262,14 @@ configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attribu
configparser.SectionProxy.getboolean # SectionProxy get functions are set in __init__
configparser.SectionProxy.getfloat # SectionProxy get functions are set in __init__
configparser.SectionProxy.getint # SectionProxy get functions are set in __init__
# 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__
_?contextvars.Context.__init__ # C signature is broader than what is actually accepted
copy.PyStringMap # defined only in Jython
# The Dialect properties are initialized as None in Dialect but their values are enforced in _Dialect
@@ -296,7 +312,10 @@ email.policy.EmailPolicy.message_factory # "type" at runtime, but protocol in s
enum.auto.__or__ # enum.auto is magic, see comments
enum.auto.__and__ # enum.auto is magic, see comments
enum.auto.__xor__ # enum.auto is magic, see comments
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
functools.cached_property.__set__ # doesn't exist, but cached_property is settable by another mechanism
_?hashlib.scrypt # Raises TypeError if salt, n, r or p are None
hmac.new # Raises TypeError if optional argument digestmod is not provided
http.HTTPStatus.description # set in __new__; work-around for enum wierdness
@@ -310,6 +329,7 @@ importlib._bootstrap_external.FileLoader.get_resource_reader
importlib._bootstrap_external.FileLoader.load_module
importlib.abc.FileLoader.get_filename
importlib.abc.FileLoader.load_module
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
importlib.machinery.ExtensionFileLoader.get_filename
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
@@ -377,6 +397,7 @@ multiprocessing.synchronize.SemLock.release
numbers.Number.__hash__ # typeshed marks this as abstract but code just sets this as None
optparse.Values.__getattr__ # Some attributes are set in __init__ using setattr
os._wrap_close.read # Methods that come from __getattr__() at runtime
os._wrap_close.readable # Methods that come from __getattr__() at runtime
os._wrap_close.readline # Methods that come from __getattr__() at runtime
@@ -384,6 +405,8 @@ os._wrap_close.readlines # Methods that come from __getattr__() at runtime
os._wrap_close.writable # Methods that come from __getattr__() at runtime
os._wrap_close.write # Methods that come from __getattr__() at runtime
os._wrap_close.writelines # Methods that come from __getattr__() at runtime
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
pickle._Pickler\..* # Best effort typing for undocumented internals
pickle._Unpickler\..* # Best effort typing for undocumented internals
_?queue.SimpleQueue.__init__ # C signature is broader than what is actually accepted
@@ -433,6 +456,11 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
turtle.ScrolledCanvas.select_item # Dynamically created, has unnecessary *args
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing.type_check_only # typing decorator that is not available at runtime
# Details of runtime definition don't need to be in stubs
@@ -468,6 +496,7 @@ typing(_extensions)?\.Match
typing(_extensions)?\.MutableMapping
typing(_extensions)?\.MutableSequence
typing(_extensions)?\.MutableSet
typing(_extensions)?\.NamedTuple
typing(_extensions)?\.Pattern
typing(_extensions)?\.Reversible
typing(_extensions)?\.Sequence
@@ -475,7 +504,6 @@ typing(_extensions)?\.Sized
typing(_extensions)?\.ValuesView
typing_extensions\.Final
typing_extensions\.LiteralString
typing_extensions\.NamedTuple
typing._SpecialForm.__call__ # Typing-related weirdness
typing._SpecialForm.__init__ # Typing-related weirdness
@@ -512,11 +540,14 @@ urllib.response.addbase.write # Methods that come from __getattr__() at runtime
urllib.response.addbase.writelines # Methods that come from __getattr__() at runtime
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
unittest.mock.patch # function with attributes, which we approximate with a callable class
_?weakref\.CallableProxyType\.__getattr__ # Should have all attributes of proxy
_?weakref\.(ref|ReferenceType)\.__init__ # C implementation has incorrect signature
_?weakref\.(ref|ReferenceType)\.__call__ # C function default annotation is wrong
_?weakref\.ProxyType\.__getattr__ # Should have all attributes of proxy
_?weakref\.ProxyType\.__reversed__ # Doesn't really exist
weakref.WeakValueDictionary.setdefault # has a default value for the "default" argument, but always errors out if no value is supplied for the parameter by the user
webbrowser.UnixBrowser.remote_action # Always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newtab # Always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newwin # Always overridden in inheriting class

View File

@@ -1,51 +0,0 @@
# ======
# <= 3.9
# ======
# Added in Python 3.8.14
sys.set_int_max_str_digits
sys.get_int_max_str_digits
# =======
# <= 3.10
# =======
# Incompatible changes introduced in Python 3.8.17
# (Remove once 3.8.17 becomes available for GitHub Actions)
shutil.unpack_archive
tarfile.AbsoluteLinkError
tarfile.AbsolutePathError
tarfile.FilterError
tarfile.LinkOutsideDestinationError
tarfile.OutsideDestinationError
tarfile.SpecialFileError
tarfile.TarFile.extract
tarfile.TarFile.extractall
tarfile.TarInfo.replace
tarfile.data_filter
tarfile.fully_trusted_filter
tarfile.tar_filter
# Incompatible changes introduced in Python 3.8.19
# (Remove once 3.8.19 becomes available for GitHub Actions)
pyexpat.XMLParserType.GetReparseDeferralEnabled
pyexpat.XMLParserType.SetReparseDeferralEnabled
xml.etree.ElementTree.XMLParser.flush
xml.etree.ElementTree.XMLPullParser.flush
xml.etree.cElementTree.XMLParser.flush
xml.etree.cElementTree.XMLPullParser.flush
xml.parsers.expat.XMLParserType.GetReparseDeferralEnabled
xml.parsers.expat.XMLParserType.SetReparseDeferralEnabled
xml.sax.expatreader.ExpatParser.flush
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
# =============================================================
# Doesn't exist on macos:
_msi
msilib(.[a-z]+)?
ossaudiodev
spwd

View File

@@ -1,36 +0,0 @@
# ======
# <= 3.8
# ======
# Incompatible changes introduced in Python 3.8.19
# (Remove once 3.8.19 becomes available for GitHub Actions)
pyexpat.XMLParserType.GetReparseDeferralEnabled
pyexpat.XMLParserType.SetReparseDeferralEnabled
xml.etree.ElementTree.XMLParser.flush
xml.etree.ElementTree.XMLPullParser.flush
xml.etree.cElementTree.XMLParser.flush
xml.etree.cElementTree.XMLPullParser.flush
xml.parsers.expat.XMLParserType.GetReparseDeferralEnabled
xml.parsers.expat.XMLParserType.SetReparseDeferralEnabled
xml.sax.expatreader.ExpatParser.flush
# ======
# <= 3.9
# ======
# `eventmask` argument exists at runtime, but is not correctly recognized
# while being inspected by stubtest. Fixed in Python 3.10.
select.epoll.register
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
# =============================================================
# doesn't exist on linux
_msi
msilib(.[a-z]+)?
# doesn't exist in all installations
(nis)?

View File

@@ -72,18 +72,6 @@ importlib.metadata._meta.SimplePath.__truediv__ # Runtime definition of protoco
# ===================================
# ======
# >= 3.9
# ======
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
# ===========
# 3.9 to 3.10
# ===========
@@ -181,29 +169,6 @@ unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will err
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.9
# ============================================================
_ast.ImportFrom.level # None on the class, but never None on instances
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.ImportFrom.level # None on the class, but never None on instances
# 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__
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing\.NamedTuple # Super-special typing primitive
weakref.ProxyType.__reversed__ # Doesn't really exist
# ===============================================================
# Allowlist entries that cannot or should not be fixed; 3.10 only
# ===============================================================

View File

@@ -60,18 +60,6 @@ typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines
# ======
# >= 3.9
# ======
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
# ============
# 3.10 to 3.11
# ============
@@ -162,29 +150,6 @@ unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will err
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.9
# ============================================================
_ast.ImportFrom.level # None on the class, but never None on instances
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.ImportFrom.level # None on the class, but never None on instances
# 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__
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing\.NamedTuple # Super-special typing primitive
weakref.ProxyType.__reversed__ # Doesn't really exist
# ===============================================================
# Allowlist entries that cannot or should not be fixed; 3.11 only
# ===============================================================

View File

@@ -59,18 +59,6 @@ typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines
# ======
# >= 3.9
# ======
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
# =======
# <= 3.12
# =======
@@ -175,29 +163,6 @@ unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will err
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.9
# ============================================================
_ast.ImportFrom.level # None on the class, but never None on instances
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.ImportFrom.level # None on the class, but never None on instances
# 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__
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing\.NamedTuple # Super-special typing primitive
weakref.ProxyType.__reversed__ # Doesn't really exist
# ===============================================================
# Allowlist entries that cannot or should not be fixed; 3.12 only
# ===============================================================

View File

@@ -59,18 +59,6 @@ typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines
# ======
# >= 3.9
# ======
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.13
# =============================================================
@@ -163,26 +151,3 @@ dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
unittest.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
unittest.case.TestCase.__init_subclass__ # Runtime has *args, **kwargs, but will error if any are supplied
# ============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.9
# ============================================================
_ast.ImportFrom.level # None on the class, but never None on instances
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.ImportFrom.level # None on the class, but never None on instances
# 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__
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing\.NamedTuple # Super-special typing primitive
weakref.ProxyType.__reversed__ # Doesn't really exist

View File

@@ -1,295 +0,0 @@
# ======
# <= 3.8
# ======
_dummy_threading.Condition.acquire
_dummy_threading.Condition.release
_dummy_threading.ExceptHookArgs
_dummy_threading.Lock
_dummy_threading.RLock
_dummy_threading.Thread.native_id
asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
builtins.float.__set_format__ # Internal method for CPython test suite
dummy_threading.Condition.acquire
dummy_threading.Condition.release
dummy_threading.Thread.native_id
typing.NamedTuple.__new__
typing.NamedTuple._asdict
typing.NamedTuple._make
typing.NamedTuple._replace
typing._SpecialForm.__new__
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
tkinter.Tcl # Default values given in the stub are a white lie, see #9637
tkinter.Tk.__init__ # Default values given in the stub are a white lie, see #9637
# Exists at runtime, but missing from stubs
_?contextvars.ContextVar.__class_getitem__
dummy_threading.ExceptHookArgs
dummy_threading.Lock
dummy_threading.RLock
html.parser.HTMLParser.unescape
plistlib.Data.asBase64
plistlib.Data.fromBase64
tempfile.SpooledTemporaryFile.softspace
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.dnd.Icon
tkinter.dnd.Tester
tkinter.dnd.test
tkinter.filedialog.[A-Z_]+
tkinter.filedialog.TclVersion
tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
# ======
# <= 3.9
# ======
builtins.input # Incorrect default value in text signature, fixed in 3.10
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.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
collections.AsyncIterator.__anext__ # async at runtime, deliberately not in the stub, see #7491
collections.ByteString # see comments in py3_common.txt
collections.Callable
collections.Mapping.get # Adding None to the Union messed up mypy
collections.Sequence.index # Supporting None in end is not mandatory
xxsubtype # module missing from the stubs
# =======
# <= 3.10
# =======
email.contentmanager.typ
gettext.install # codeset default value is ['unspecified'] so can't be specified
gettext.translation # codeset default value is ['unspecified'] so can't be specified
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
# 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
tkinter.Tk.split # Exists at runtime, but missing from stubs
# =======
# <= 3.11
# =======
_?bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set
configparser.ParsingError.filename
enum.Enum._generate_next_value_
importlib.abc.Finder.find_module
xml.etree.ElementTree.Element.__bool__ # Doesn't really exist; see comments in stub
xml.etree.cElementTree.Element.__bool__ # Doesn't really exist; see comments in stub
# =======
# <= 3.12
# =======
# Exists at runtime, but missing from stubs
lib2to3.btm_utils
lib2to3.fixer_util
lib2to3.patcomp
lib2to3.pgen2.grammar.Grammar.loads
lib2to3.pygram.pattern_symbols
lib2to3.pygram.python_symbols
lib2to3.pytree.Base.__new__
lib2to3.pytree.Base.children
lib2to3.pytree.Base.type
lib2to3.pytree.BasePattern.__new__
lib2to3.pytree.BasePattern.type
lib2to3.pytree.NegatedPattern.match
lib2to3.pytree.NegatedPattern.match_seq
tkinter.tix.[A-Z_]+
tkinter.tix.CObjView
tkinter.tix.DialogShell
tkinter.tix.ExFileSelectDialog
tkinter.tix.FileSelectDialog
tkinter.tix.FileTypeList
tkinter.tix.Grid
tkinter.tix.NoteBookFrame
tkinter.tix.OptionName
tkinter.tix.ResizeHandle
tkinter.tix.ScrolledGrid
tkinter.tix.ScrolledHList
tkinter.tix.ScrolledListBox
tkinter.tix.ScrolledTList
tkinter.tix.ScrolledText
tkinter.tix.ScrolledWindow
tkinter.tix.Shell
tkinter.tix.TclVersion
tkinter.tix.TkVersion
# ============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.8
# ============================================================
asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omitted from the stub
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
# Incompatible changes introduced in Python 3.8.20
# (Remove once 3.8.20 becomes available for GitHub Actions)
email._header_value_parser.NLSET
email._header_value_parser.SPECIALSNL
email.errors.HeaderWriteError
email.utils.getaddresses
email.utils.parseaddr
# Weird special builtins that are typed as functions, but aren't functions
hashlib.sha3_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+
hashlib.shake_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+
zipfile.Path.open # A property at runtime that works like a method.
# ============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.9
# ============================================================
_ssl.RAND_egd # Depends on the existence and flags of SSL
builtins.classmethod.__get__ # Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
builtins.property.__get__ # Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
builtins.staticmethod.__get__ # Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
builtins.memoryview.__iter__ # C type that implements __getitem__
builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only
collections.Mapping.__reversed__ # Set to None at runtime for a better error message, omitted from typeshed
# 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__
ssl.RAND_egd # Depends on the existence and flags of SSL
test # Modules that exist at runtime, but shouldn't be added to typeshed
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
types.ClassMethodDescriptorType.__get__
types.FunctionType.__get__
types.GetSetDescriptorType.__get__
types.LambdaType.__get__
types.MemberDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.10
# =============================================================
# 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
pstats.SortKey.__new__ # Derives from (str, Enum)
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
sqlite3.test # Modules that exist at runtime, but shouldn't be added to typeshed
sqlite3\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
tkinter.EventType.__new__ # Derives from (str, Enum)
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.11
# =============================================================
.*.__buffer__ # We lie about the existence of these methods
.*.__release_buffer__ # We lie about the existence of these methods
asynchat.async_chat.encoding # Removed in 3.12
asynchat.async_chat.use_encoding # Removed in 3.12
asynchat.find_prefix_at_end # Removed in 3.12
asyncore.dispatcher.addr # Removed in 3.12
asyncore.dispatcher.handle_accepted # Removed in 3.12
ctypes.test # Modules that exist at runtime, but shouldn't be added to typeshed
ctypes\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
distutils\..* # Removed in 3.12
lib2to3.tests # Modules that exist at runtime, but shouldn't be added to typeshed
lib2to3\.tests\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
pkgutil.ImpImporter\..* # Removed in 3.12
pkgutil.ImpLoader\..* # Removed in 3.12
poplib.POP3_SSL.stls # bad declaration of inherited function. See poplib.pyi
tkinter.test # Modules that exist at runtime, but shouldn't be added to typeshed
tkinter\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
# Exist at runtime for internal reasons, no need to put them in the stub
typing_extensions\.TypeAliasType\.__call__
typing_extensions\.TypeAliasType\.__init_subclass__
# We call them read-only properties, runtime implementation is slightly different
typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
# =============================================================
# Undocumented implementation details
cgi.FieldStorage.bufsize
cgi.FieldStorage.read_binary
cgi.FieldStorage.read_lines
cgi.FieldStorage.read_lines_to_eof
cgi.FieldStorage.read_lines_to_outerboundary
cgi.FieldStorage.read_multi
cgi.FieldStorage.read_single
cgi.FieldStorage.read_urlencoded
cgi.FieldStorage.skip_lines
ctypes._endian.DEFAULT_MODE # Incorrectly star import.
ctypes._endian.RTLD_GLOBAL # Incorrectly star import.
ctypes._endian.RTLD_LOCAL # Incorrectly star import.
multiprocessing.dummy.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
# But have more precise (accurate) signatures in the stub
multiprocessing.managers.DictProxy.__iter__
multiprocessing.managers.DictProxy.__len__
multiprocessing.managers.DictProxy.copy
multiprocessing.managers.DictProxy.items
multiprocessing.managers.DictProxy.keys
multiprocessing.managers.DictProxy.values
# Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
multiprocessing.managers.DictProxy.clear
multiprocessing.managers.DictProxy.popitem
# Undocumented implementation details
pipes.Template.makepipeline
pipes.Template.open_r
pipes.Template.open_w
sunau.Au_read.initfp
sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details

View File

@@ -3,18 +3,6 @@
# ========================
# ======
# >= 3.9
# ======
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
# ========
# 3.9 only
# ========
@@ -129,28 +117,6 @@ tkinter.tix.Shell
tkinter.tix.TclVersion
tkinter.tix.TkVersion
# ============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.9
# ============================================================
_ast.ImportFrom.level # None on the class, but never None on instances
_weakref.ProxyType.__reversed__ # Doesn't really exist
ast.ImportFrom.level # None on the class, but never None on instances
# 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__
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
typing\.NamedTuple # Super-special typing primitive
weakref.ProxyType.__reversed__ # Doesn't really exist
# ==============================================================
# Allowlist entries that cannot or should not be fixed; 3.9 only

View File

@@ -1,75 +0,0 @@
# ======
# <= 3.9
# ======
# Added in Python 3.8.14
sys.set_int_max_str_digits
sys.get_int_max_str_digits
# =======
# <= 3.10
# =======
# Incompatible changes introduced in Python 3.8.17
# (Remove once 3.8.17 becomes available for GitHub Actions)
shutil.unpack_archive
tarfile.AbsoluteLinkError
tarfile.AbsolutePathError
tarfile.FilterError
tarfile.LinkOutsideDestinationError
tarfile.OutsideDestinationError
tarfile.SpecialFileError
tarfile.TarFile.extract
tarfile.TarFile.extractall
tarfile.TarInfo.replace
tarfile.data_filter
tarfile.fully_trusted_filter
tarfile.tar_filter
# Incompatible changes introduced in Python 3.8.19
# (Remove once 3.8.19 becomes available for GitHub Actions)
pyexpat.XMLParserType.GetReparseDeferralEnabled
pyexpat.XMLParserType.SetReparseDeferralEnabled
xml.etree.ElementTree.XMLParser.flush
xml.etree.ElementTree.XMLPullParser.flush
xml.etree.cElementTree.XMLParser.flush
xml.etree.cElementTree.XMLPullParser.flush
xml.parsers.expat.XMLParserType.GetReparseDeferralEnabled
xml.parsers.expat.XMLParserType.SetReparseDeferralEnabled
xml.sax.expatreader.ExpatParser.flush
# ============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.8
# ============================================================
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.WindowsPath.group
pathlib.WindowsPath.owner
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.11
# =============================================================
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount
pathlib.WindowsPath.is_mount
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
# =============================================================
# Modules that don't exist on Windows
crypt
nis
ossaudiodev
spwd
# pathlib functions that rely on modules that don't exist on Windows
pathlib.Path.owner
pathlib.Path.group