diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index d8956df6b327..761945e91f80 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -59,6 +59,7 @@ _frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY _frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY_DEBUG builtins.OSError.characters_written # GetSetDescriptor that always raises AttributeError +builtins.ellipsis # does not exist at runtime, see https://github.com/python/typeshed/issues/7580 builtins.float.__getformat__ # Internal method for CPython test suite # These super() dunders don't seem to be particularly useful, @@ -180,11 +181,22 @@ sys.tracebacklimit # Must be set first # ========================================================== # async at runtime, deliberately not in the stub, see #7491 -_collections_abc.AsyncGenerator.asend # pos-only differences also. +_collections_abc.AsyncGenerator.asend # pos-only differences also _collections_abc.AsyncGenerator.__anext__ _collections_abc.AsyncGenerator.aclose +_collections_abc.AsyncGenerator.athrow # pos-only differences also _collections_abc.AsyncIterator.__anext__ +# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib +_collections_abc.Coroutine.send +_collections_abc.Coroutine.throw +_collections_abc.Generator.send +_collections_abc.Generator.throw + +# These are not positional-only at runtime, but we treat them as positional-only to match dict. +_collections_abc.MutableMapping.pop +_collections_abc.MutableMapping.setdefault + # Pretend typing.ByteString is a Union, to better match its documented semantics. # As a side effect, this changes the definition of collections.abc.ByteString, which is okay, # because it's not an ABC that makes any sense and was deprecated in 3.12 @@ -217,6 +229,7 @@ argparse.Namespace.__getattr__ # The whole point of this class is its attribute _?ast.AST.__init__ _?ast.excepthandler.__init__ _?ast.expr.__init__ +_?ast.pattern.__init__ _?ast.stmt.__init__ _ast.ImportFrom.level # None on the class, but never None on instances @@ -235,6 +248,7 @@ asyncio.locks.Condition.locked asyncio.locks.Condition.release builtins.memoryview.__contains__ # C type that implements __getitem__ +builtins.property.__set_name__ # Doesn't actually exist builtins.reveal_locals # Builtins that type checkers pretends exist builtins.reveal_type # Builtins that type checkers pretends exist @@ -251,6 +265,7 @@ codecs.CodecInfo.streamwriter codecs.StreamReaderWriter.\w+ codecs.StreamRecoder.\w+ +collections.UserList.index # ignoring pos-or-keyword parameter collections.UserList.sort # Runtime has *args but will error if any are supplied collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attributes when custom converters are used @@ -287,6 +302,8 @@ _?ctypes.Union.__setattr__ # doesn't exist, but makes things easy if we pretend # These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220 _?ctypes.Array.__iter__ +dataclasses.KW_ONLY # white lies around defaults + # __all__-related weirdness (see #6523) email.__all__ email.base64mime @@ -317,6 +334,8 @@ http.HTTPStatus.description # set in __new__; work-around for enum wierdness http.HTTPStatus.phrase # set in __new__; work-around for enum wierdness imaplib.IMAP4_SSL.ssl # Depends on the existence and flags of SSL +importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility + # runtime is *args, **kwargs due to a wrapper; we have more accurate signatures in the stubs importlib._bootstrap_external.ExtensionFileLoader.get_filename importlib._bootstrap_external.FileLoader.get_filename @@ -326,6 +345,8 @@ importlib.abc.FileLoader.get_filename importlib.abc.FileLoader.load_module importlib.machinery.ExtensionFileLoader.get_filename +importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect + # We can't distinguish not having a default value from having a default value of inspect.Parameter.empty inspect.Parameter.__init__ inspect.Signature.__init__ @@ -446,6 +467,8 @@ 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 +# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) +tkinter.ttk.Style.element_create types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ @@ -516,6 +539,17 @@ typing(_extensions)?\.(Async)?ContextManager typing(_extensions)?\.IO\.__iter__ typing(_extensions)?\.IO\.__next__ +# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer +# to mark these as positional-only for compatibility with existing sub-classes. +typing(_extensions)?\.BinaryIO\.write +typing(_extensions)?\.IO\.read +typing(_extensions)?\.IO\.readline +typing(_extensions)?\.IO\.readlines +typing(_extensions)?\.IO\.seek +typing(_extensions)?\.IO\.truncate +typing(_extensions)?\.IO\.write +typing(_extensions)?\.IO\.writelines + types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist. types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist. types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist. @@ -550,3 +584,8 @@ xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signatu # These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220 xml.etree.ElementTree.Element.__iter__ xml.etree.cElementTree.Element.__iter__ + +# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 +posixpath.join +ntpath.join +os.path.join diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py39.txt b/stdlib/@tests/stubtest_allowlists/darwin-py39.txt deleted file mode 100644 index 0e55e7f25a3f..000000000000 --- a/stdlib/@tests/stubtest_allowlists/darwin-py39.txt +++ /dev/null @@ -1,83 +0,0 @@ -# ========= -# Temporary -# ========= - -# Added in Python 3.9.14 -# (Remove once 3.9.14 becomes available for GitHub Actions) -sys.set_int_max_str_digits -sys.get_int_max_str_digits - -# Incompatible changes introduced in Python 3.9.17 -# (Remove once 3.9.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.9.19 -# (Remove once 3.9.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 -zipfile.ZipInfo.__slots__ - -# Incompatible changes introduced in Python 3.9.20 -# (Remove once 3.9.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 - -# Incompatible changes introduced in Python 3.9.22 -# (Remove once 3.9.22 becomes available for GitHub Actions) -email._header_value_parser.get_encoded_word - -# Incompatible changes introduced in Python 3.9.23 -# (Remove once 3.9.23 becomes available for GitHub Actions) -genericpath.__all__ -genericpath.ALLOW_MISSING -(ntpath.__all__)? -(ntpath.ALLOW_MISSING)? -(ntpath.realpath)? -(os.path.__all__)? -(os.path.ALLOW_MISSING)? -(os.path.realpath)? -(posixpath.__all__)? -(posixpath.ALLOW_MISSING)? -(posixpath.realpath)? -tarfile.LinkFallbackError -tarfile.TarFile._extract_member -tarfile.TarFile.makelink_with_filter -html.parser.HTMLParser.set_cdata_mode # parameter `escapable` -email._header_value_parser.make_quoted_pairs - -# Parameter `scripting` added in Python 3.9.25 -# (Remove once 3.9.25 becomes available for GitHub Actions) -html.parser.HTMLParser.__init__ - - -# ============================================================= -# Allowlist entries that cannot or should not be fixed; <= 3.12 -# ============================================================= - -# Doesn't exist on macos: -_msi -msilib(.[a-z]+)? -ossaudiodev -spwd diff --git a/stdlib/@tests/stubtest_allowlists/linux-py39.txt b/stdlib/@tests/stubtest_allowlists/linux-py39.txt deleted file mode 100644 index b92f8267f499..000000000000 --- a/stdlib/@tests/stubtest_allowlists/linux-py39.txt +++ /dev/null @@ -1,25 +0,0 @@ -# ======== -# 3.9 only -# ======== - -# `eventmask` argument exists at runtime, but is not correctly recognized -# while being inspected by stubtest. Fixed in Python 3.10. -select.epoll.register - -# According to stubtest, these are sometimes not present at runtime, starting -# with Python 3.9.24. Which is not true. -(_frozen_importlib_external.PathFinder.find_distributions)? -(importlib._bootstrap_external.PathFinder.find_distributions)? -(importlib.machinery.PathFinder.find_distributions)? - - -# ============================================================= -# 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)? diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index b11ea3c6c7db..403a93a5e26f 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -3,43 +3,6 @@ # ========================= -# ======= -# >= 3.10 -# ======= - -builtins.ellipsis # type is not exposed anywhere -importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility - -# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw - -# These are not positional-only at runtime, but we treat them as positional-only to match dict. -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault - -# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 -posixpath.join -ntpath.join -os.path.join - -# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) -tkinter.ttk.Style.element_create - -# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer -# to mark these as positional-only for compatibility with existing sub-classes. -typing(_extensions)?\.BinaryIO\.write -typing(_extensions)?\.IO\.read -typing(_extensions)?\.IO\.readline -typing(_extensions)?\.IO\.readlines -typing(_extensions)?\.IO\.seek -typing(_extensions)?\.IO\.truncate -typing(_extensions)?\.IO\.write -typing(_extensions)?\.IO\.writelines - - # ========= # 3.10 only # ========= @@ -166,22 +129,6 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see typing_extensions.TypeAliasType.__call__ -# ============================================================= -# Allowlist entries that cannot or should not be fixed; >= 3.10 -# ============================================================= - -# Runtime AST node runtime constructor behaviour is too loose. -# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378). -# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858) -_?ast.pattern.__init__ - -_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. -builtins.property.__set_name__ # Doesn't actually exist -collections\.UserList\.index # ignoring pos-or-keyword parameter -dataclasses.KW_ONLY # white lies around defaults -importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect - - # =============================================================== # Allowlist entries that cannot or should not be fixed; 3.10 only # =============================================================== diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index e7ef0c7af054..56cf672fda59 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -23,43 +23,6 @@ enum.StrEnum._generate_next_value_ # ==================================== -# ======= -# >= 3.10 -# ======= - -builtins.ellipsis # type is not exposed anywhere -importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility - -# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw - -# These are not positional-only at runtime, but we treat them as positional-only to match dict. -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault - -# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 -posixpath.join -ntpath.join -os.path.join - -# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) -tkinter.ttk.Style.element_create - -# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer -# to mark these as positional-only for compatibility with existing sub-classes. -typing(_extensions)?\.BinaryIO\.write -typing(_extensions)?\.IO\.read -typing(_extensions)?\.IO\.readline -typing(_extensions)?\.IO\.readlines -typing(_extensions)?\.IO\.seek -typing(_extensions)?\.IO\.truncate -typing(_extensions)?\.IO\.write -typing(_extensions)?\.IO\.writelines - - # ============ # 3.10 to 3.11 # ============ @@ -152,22 +115,6 @@ typing\._SpecialForm.* # Super-special typing primitive typing\.LiteralString # Super-special typing primitive -# ============================================================= -# Allowlist entries that cannot or should not be fixed; >= 3.10 -# ============================================================= - -# Runtime AST node runtime constructor behaviour is too loose. -# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378). -# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858) -_?ast.pattern.__init__ - -_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. -builtins.property.__set_name__ # Doesn't actually exist -collections\.UserList\.index # ignoring pos-or-keyword parameter -dataclasses.KW_ONLY # white lies around defaults -importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect - - # =============================================================== # Allowlist entries that cannot or should not be fixed; 3.11 only # =============================================================== diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index 24e1b1f80d37..d5d66bddfe59 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -40,43 +40,6 @@ typing.NewType.__mro_entries__ enum.Enum.__init__ -# ======= -# >= 3.10 -# ======= - -builtins.ellipsis # type is not exposed anywhere -importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility - -# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw - -# These are not positional-only at runtime, but we treat them as positional-only to match dict. -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault - -# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 -posixpath.join -ntpath.join -os.path.join - -# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) -tkinter.ttk.Style.element_create - -# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer -# to mark these as positional-only for compatibility with existing sub-classes. -typing(_extensions)?\.BinaryIO\.write -typing(_extensions)?\.IO\.read -typing(_extensions)?\.IO\.readline -typing(_extensions)?\.IO\.readlines -typing(_extensions)?\.IO\.seek -typing(_extensions)?\.IO\.truncate -typing(_extensions)?\.IO\.write -typing(_extensions)?\.IO\.writelines - - # ======= # <= 3.12 # ======= @@ -184,22 +147,6 @@ typing\.LiteralString # Super-special typing primitive argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super -# ============================================================= -# Allowlist entries that cannot or should not be fixed; >= 3.10 -# ============================================================= - -# Runtime AST node runtime constructor behaviour is too loose. -# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378). -# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858) -_?ast.pattern.__init__ - -_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. -builtins.property.__set_name__ # Doesn't actually exist -collections\.UserList\.index # ignoring pos-or-keyword parameter -dataclasses.KW_ONLY # white lies around defaults -importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect - - # =============================================================== # Allowlist entries that cannot or should not be fixed; 3.12 only # =============================================================== diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index a79fc83fe0c7..27d7a14a36d6 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -40,43 +40,6 @@ typing.NewType.__mro_entries__ enum.Enum.__init__ -# ======= -# >= 3.10 -# ======= - -builtins.ellipsis # type is not exposed anywhere -importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility - -# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw - -# These are not positional-only at runtime, but we treat them as positional-only to match dict. -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault - -# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 -posixpath.join -ntpath.join -os.path.join - -# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) -tkinter.ttk.Style.element_create - -# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer -# to mark these as positional-only for compatibility with existing sub-classes. -typing(_extensions)?\.BinaryIO\.write -typing(_extensions)?\.IO\.read -typing(_extensions)?\.IO\.readline -typing(_extensions)?\.IO\.readlines -typing(_extensions)?\.IO\.seek -typing(_extensions)?\.IO\.truncate -typing(_extensions)?\.IO\.write -typing(_extensions)?\.IO\.writelines - - # ======= # <= 3.13 # ======= @@ -174,19 +137,3 @@ typing\.LiteralString # Super-special typing primitive # ================================================================== argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super - - -# ============================================================= -# Allowlist entries that cannot or should not be fixed; >= 3.10 -# ============================================================= - -# Runtime AST node runtime constructor behaviour is too loose. -# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378). -# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858) -_?ast.pattern.__init__ - -_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. -builtins.property.__set_name__ # Doesn't actually exist -collections\.UserList\.index # ignoring pos-or-keyword parameter -dataclasses.KW_ONLY # white lies around defaults -importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 2ed18b5a2fea..59d0fd81a77f 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -71,43 +71,6 @@ types.SimpleNamespace.__delattr__ typing.NewType.__mro_entries__ -# ======= -# >= 3.10 -# ======= - -builtins.ellipsis # type is not exposed anywhere -importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility - -# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw - -# These are not positional-only at runtime, but we treat them as positional-only to match dict. -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault - -# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 -posixpath.join -ntpath.join -os.path.join - -# this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that) -tkinter.ttk.Style.element_create - -# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer -# to mark these as positional-only for compatibility with existing sub-classes. -typing(_extensions)?\.BinaryIO\.write -typing(_extensions)?\.IO\.read -typing(_extensions)?\.IO\.readline -typing(_extensions)?\.IO\.readlines -typing(_extensions)?\.IO\.seek -typing(_extensions)?\.IO\.truncate -typing(_extensions)?\.IO\.write -typing(_extensions)?\.IO\.writelines - - # ============================================================= # Allowlist entries that cannot or should not be fixed; >= 3.14 # ============================================================= @@ -212,19 +175,3 @@ importlib.resources.abc.Traversable.open # Problematic protocol signature at ru inspect._ParameterKind.description # Still exists, but stubtest can't see it typing\._SpecialForm.* # Super-special typing primitive typing\.LiteralString # Super-special typing primitive - - -# ============================================================= -# Allowlist entries that cannot or should not be fixed; >= 3.10 -# ============================================================= - -# Runtime AST node runtime constructor behaviour is too loose. -# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378). -# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858) -_?ast.pattern.__init__ - -_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. -builtins.property.__set_name__ # Doesn't actually exist -collections\.UserList\.index # ignoring pos-or-keyword parameter -dataclasses.KW_ONLY # white lies around defaults -importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt deleted file mode 100644 index 76ee91c4cb1b..000000000000 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ /dev/null @@ -1,257 +0,0 @@ -# ======== -# 3.9 only -# ======== - -# Exists at runtime, but missing from stubs -collections.AsyncIterable.__class_getitem__ -collections.Awaitable.__class_getitem__ -collections.Container.__class_getitem__ -collections.Iterable.__class_getitem__ -collections.MappingView.__class_getitem__ -hmac.HMAC.digest_cons -hmac.HMAC.inner -hmac.HMAC.outer -xxsubtype # module missing from the stubs - -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 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 - - -# ======= -# <= 3.10 -# ======= - -builtins.float.__setformat__ # Internal method for CPython test suite -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 -typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs - -# Will always raise. Not included to avoid type checkers inferring that -# Sentinel instances are callable. -typing_extensions.Sentinel.__call__ - - -# ======= -# <= 3.11 -# ======= - -enum.Enum._generate_next_value_ -importlib.abc.Finder.find_module -urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified -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 - - -# ======= -# <= 3.13 -# ======= - -ast.Ellipsis.__new__ # Implementation has *args, but shouldn't allow any - -_?hashlib.scrypt # Raises TypeError if salt, n, r or p are None - -importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments. - -# Will always raise. Not included to avoid type checkers inferring that -# TypeAliasType instances are callable. -typing_extensions.TypeAliasType.__call__ - - -# ============================================================== -# Allowlist entries that cannot or should not be fixed; 3.9 only -# ============================================================== - -ast.FormattedValue.conversion # None on the class, but never None on instances -_ast.FormattedValue.conversion # None on the class, but never None on instances - -_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 -platform.platform # runtime default is 0, we pretend it's a bool -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 - -# 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 -typing\.Annotated # Super-special typing primitive - -# These methods have no default implementation for Python < 3.13. -_pickle.Pickler.persistent_id -_pickle.Unpickler.persistent_load -pickle.Pickler.persistent_id -pickle.Unpickler.persistent_load diff --git a/stdlib/@tests/stubtest_allowlists/win32-py39.txt b/stdlib/@tests/stubtest_allowlists/win32-py39.txt deleted file mode 100644 index 9e7cf677f711..000000000000 --- a/stdlib/@tests/stubtest_allowlists/win32-py39.txt +++ /dev/null @@ -1,89 +0,0 @@ -# ========= -# Temporary -# ========= - -# According to stubtest, these are sometimes not present at runtime, starting -# with Python 3.9.13. Which is not true. -(_frozen_importlib_external.PathFinder.find_distributions)? -(importlib._bootstrap_external.PathFinder.find_distributions)? -(importlib.machinery.PathFinder.find_distributions)? - -# Added in Python 3.9.14 -# (Remove once 3.9.14 becomes available for GitHub Actions) -sys.set_int_max_str_digits -sys.get_int_max_str_digits - -# Incompatible changes introduced in Python 3.9.17 -# (Remove once 3.9.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.9.19 -# (Remove once 3.9.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 -zipfile.ZipInfo.__slots__ - -# Incompatible changes introduced in Python 3.9.20 -# (Remove once 3.9.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 - -# Incompatible changes introduced in Python 3.9.22 -# (Remove once 3.9.22 becomes available for GitHub Actions) -email._header_value_parser.get_encoded_word - -# Incompatible changes introduced in Python 3.9.23 -# (Remove once 3.9.23 becomes available for GitHub Actions) -genericpath.__all__ -genericpath.ALLOW_MISSING -(ntpath.__all__)? -(ntpath.ALLOW_MISSING)? -(ntpath.realpath)? -(os.path.__all__)? -(os.path.ALLOW_MISSING)? -(os.path.realpath)? -(posixpath.__all__)? -(posixpath.ALLOW_MISSING)? -(posixpath.realpath)? -tarfile.LinkFallbackError -tarfile.TarFile._extract_member -tarfile.TarFile.makelink_with_filter -html.parser.HTMLParser.set_cdata_mode # parameter `escapable` -email._header_value_parser.make_quoted_pairs - -# Parameter `scripting` added in Python 3.9.25 -# (Remove once 3.9.25 becomes available for GitHub Actions) -html.parser.HTMLParser.__init__ - - -# ============================================================= -# Allowlist entries that cannot or should not be fixed; <= 3.12 -# ============================================================= - -# Modules that don't exist on Windows -crypt -nis -ossaudiodev -spwd