@@ -59,6 +59,7 @@ _frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY
5959_frozen_importlib_external.WindowsRegistryFinder.REGISTRY_KEY_DEBUG
6060
6161builtins.OSError.characters_written # GetSetDescriptor that always raises AttributeError
62+ builtins.ellipsis # does not exist at runtime, see https://github.com/python/typeshed/issues/7580
6263builtins.float.__getformat__ # Internal method for CPython test suite
6364
6465# These super() dunders don't seem to be particularly useful,
@@ -180,11 +181,22 @@ sys.tracebacklimit # Must be set first
180181# ==========================================================
181182
182183# async at runtime, deliberately not in the stub, see #7491
183- _collections_abc.AsyncGenerator.asend # pos-only differences also.
184+ _collections_abc.AsyncGenerator.asend # pos-only differences also
184185_collections_abc.AsyncGenerator.__anext__
185186_collections_abc.AsyncGenerator.aclose
187+ _collections_abc.AsyncGenerator.athrow # pos-only differences also
186188_collections_abc.AsyncIterator.__anext__
187189
190+ # positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
191+ _collections_abc.Coroutine.send
192+ _collections_abc.Coroutine.throw
193+ _collections_abc.Generator.send
194+ _collections_abc.Generator.throw
195+
196+ # These are not positional-only at runtime, but we treat them as positional-only to match dict.
197+ _collections_abc.MutableMapping.pop
198+ _collections_abc.MutableMapping.setdefault
199+
188200# Pretend typing.ByteString is a Union, to better match its documented semantics.
189201# As a side effect, this changes the definition of collections.abc.ByteString, which is okay,
190202# 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
217229_?ast.AST.__init__
218230_?ast.excepthandler.__init__
219231_?ast.expr.__init__
232+ _?ast.pattern.__init__
220233_?ast.stmt.__init__
221234
222235_ast.ImportFrom.level # None on the class, but never None on instances
@@ -235,6 +248,7 @@ asyncio.locks.Condition.locked
235248asyncio.locks.Condition.release
236249
237250builtins.memoryview.__contains__ # C type that implements __getitem__
251+ builtins.property.__set_name__ # Doesn't actually exist
238252builtins.reveal_locals # Builtins that type checkers pretends exist
239253builtins.reveal_type # Builtins that type checkers pretends exist
240254
@@ -251,6 +265,7 @@ codecs.CodecInfo.streamwriter
251265codecs.StreamReaderWriter.\w+
252266codecs.StreamRecoder.\w+
253267
268+ collections.UserList.index # ignoring pos-or-keyword parameter
254269collections.UserList.sort # Runtime has *args but will error if any are supplied
255270collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there
256271configparser.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
287302# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
288303_?ctypes.Array.__iter__
289304
305+ dataclasses.KW_ONLY # white lies around defaults
306+
290307# __all__-related weirdness (see #6523)
291308email.__all__
292309email.base64mime
@@ -317,6 +334,8 @@ http.HTTPStatus.description # set in __new__; work-around for enum wierdness
317334http.HTTPStatus.phrase # set in __new__; work-around for enum wierdness
318335imaplib.IMAP4_SSL.ssl # Depends on the existence and flags of SSL
319336
337+ importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
338+
320339# runtime is *args, **kwargs due to a wrapper; we have more accurate signatures in the stubs
321340importlib._bootstrap_external.ExtensionFileLoader.get_filename
322341importlib._bootstrap_external.FileLoader.get_filename
@@ -326,6 +345,8 @@ importlib.abc.FileLoader.get_filename
326345importlib.abc.FileLoader.load_module
327346importlib.machinery.ExtensionFileLoader.get_filename
328347
348+ importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
349+
329350# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
330351inspect.Parameter.__init__
331352inspect.Signature.__init__
@@ -446,6 +467,8 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
446467turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
447468turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
448469turtle.ScrolledCanvas.select_item # Dynamically created, has unnecessary *args
470+ # this is implemented with *args having a minimum size so arguments before it must be positional (but stubtest doesn't see that)
471+ tkinter.ttk.Style.element_create
449472
450473types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
451474types.GenericAlias.__getattr__
@@ -516,6 +539,17 @@ typing(_extensions)?\.(Async)?ContextManager
516539typing(_extensions)?\.IO\.__iter__
517540typing(_extensions)?\.IO\.__next__
518541
542+ # typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
543+ # to mark these as positional-only for compatibility with existing sub-classes.
544+ typing(_extensions)?\.BinaryIO\.write
545+ typing(_extensions)?\.IO\.read
546+ typing(_extensions)?\.IO\.readline
547+ typing(_extensions)?\.IO\.readlines
548+ typing(_extensions)?\.IO\.seek
549+ typing(_extensions)?\.IO\.truncate
550+ typing(_extensions)?\.IO\.write
551+ typing(_extensions)?\.IO\.writelines
552+
519553types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
520554types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist.
521555types.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
550584# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
551585xml.etree.ElementTree.Element.__iter__
552586xml.etree.cElementTree.Element.__iter__
587+
588+ # These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
589+ posixpath.join
590+ ntpath.join
591+ os.path.join
0 commit comments