@@ -45,6 +45,12 @@ idlelib
4545# Module members that exist at runtime, but are deliberately missing from stubs
4646# =============================================================================
4747
48+ _collections_abc.AsyncIterable.__class_getitem__
49+ _collections_abc.Awaitable.__class_getitem__
50+ _collections_abc.Container.__class_getitem__
51+ _collections_abc.Iterable.__class_getitem__
52+ _collections_abc.MappingView.__class_getitem__
53+
4854_collections_abc.Mapping.__reversed__ # set to None at runtime for a better error message
4955
5056# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
@@ -211,8 +217,11 @@ _?ast.excepthandler.__init__
211217_?ast.expr.__init__
212218_?ast.stmt.__init__
213219
220+ _ast.ImportFrom.level # None on the class, but never None on instances
221+
214222ast.Bytes.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
215223ast.Ellipsis.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
224+ ast.ImportFrom.level # None on the class, but never None on instances
216225ast.NameConstant.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
217226ast.Num.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
218227ast.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
253262configparser.SectionProxy.getboolean # SectionProxy get functions are set in __init__
254263configparser.SectionProxy.getfloat # SectionProxy get functions are set in __init__
255264configparser.SectionProxy.getint # SectionProxy get functions are set in __init__
265+
266+ # Treated an alias of a typing class in the stubs,
267+ # they are generic to type checkers anyway.
268+ contextlib.AbstractAsyncContextManager.__class_getitem__
269+ contextlib.AbstractContextManager.__class_getitem__
270+
256271_?contextvars.Context.__init__ # C signature is broader than what is actually accepted
272+
257273copy.PyStringMap # defined only in Jython
258274
259275# 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
296312enum.auto.__or__ # enum.auto is magic, see comments
297313enum.auto.__and__ # enum.auto is magic, see comments
298314enum.auto.__xor__ # enum.auto is magic, see comments
315+
316+ functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
299317functools.cached_property.__set__ # doesn't exist, but cached_property is settable by another mechanism
318+
300319_?hashlib.scrypt # Raises TypeError if salt, n, r or p are None
301320hmac.new # Raises TypeError if optional argument digestmod is not provided
302321http.HTTPStatus.description # set in __new__; work-around for enum wierdness
@@ -310,6 +329,7 @@ importlib._bootstrap_external.FileLoader.get_resource_reader
310329importlib._bootstrap_external.FileLoader.load_module
311330importlib.abc.FileLoader.get_filename
312331importlib.abc.FileLoader.load_module
332+ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
313333importlib.machinery.ExtensionFileLoader.get_filename
314334
315335# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
@@ -377,13 +397,16 @@ multiprocessing.synchronize.SemLock.release
377397
378398numbers.Number.__hash__ # typeshed marks this as abstract but code just sets this as None
379399optparse.Values.__getattr__ # Some attributes are set in __init__ using setattr
400+
380401os._wrap_close.read # Methods that come from __getattr__() at runtime
381402os._wrap_close.readable # Methods that come from __getattr__() at runtime
382403os._wrap_close.readline # Methods that come from __getattr__() at runtime
383404os._wrap_close.readlines # Methods that come from __getattr__() at runtime
384405os._wrap_close.writable # Methods that come from __getattr__() at runtime
385406os._wrap_close.write # Methods that come from __getattr__() at runtime
386407os._wrap_close.writelines # Methods that come from __getattr__() at runtime
408+ os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
409+
387410pickle._Pickler\..* # Best effort typing for undocumented internals
388411pickle._Unpickler\..* # Best effort typing for undocumented internals
389412_?queue.SimpleQueue.__init__ # C signature is broader than what is actually accepted
@@ -433,6 +456,11 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
433456turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
434457turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
435458turtle.ScrolledCanvas.select_item # Dynamically created, has unnecessary *args
459+
460+ types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
461+ types.GenericAlias.__getattr__
462+ types.GenericAlias.__mro_entries__
463+
436464typing.type_check_only # typing decorator that is not available at runtime
437465
438466# Details of runtime definition don't need to be in stubs
@@ -468,14 +496,14 @@ typing(_extensions)?\.Match
468496typing(_extensions)?\.MutableMapping
469497typing(_extensions)?\.MutableSequence
470498typing(_extensions)?\.MutableSet
499+ typing(_extensions)?\.NamedTuple
471500typing(_extensions)?\.Pattern
472501typing(_extensions)?\.Reversible
473502typing(_extensions)?\.Sequence
474503typing(_extensions)?\.Sized
475504typing(_extensions)?\.ValuesView
476505typing_extensions\.Final
477506typing_extensions\.LiteralString
478- typing_extensions\.NamedTuple
479507
480508typing._SpecialForm.__call__ # Typing-related weirdness
481509typing._SpecialForm.__init__ # Typing-related weirdness
@@ -512,11 +540,14 @@ urllib.response.addbase.write # Methods that come from __getattr__() at runtime
512540urllib.response.addbase.writelines # Methods that come from __getattr__() at runtime
513541urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
514542unittest.mock.patch # function with attributes, which we approximate with a callable class
543+
515544_?weakref\.CallableProxyType\.__getattr__ # Should have all attributes of proxy
516545_?weakref\.(ref|ReferenceType)\.__init__ # C implementation has incorrect signature
517546_?weakref\.(ref|ReferenceType)\.__call__ # C function default annotation is wrong
518547_?weakref\.ProxyType\.__getattr__ # Should have all attributes of proxy
548+ _?weakref\.ProxyType\.__reversed__ # Doesn't really exist
519549weakref.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
550+
520551webbrowser.UnixBrowser.remote_action # Always overridden in inheriting class
521552webbrowser.UnixBrowser.remote_action_newtab # Always overridden in inheriting class
522553webbrowser.UnixBrowser.remote_action_newwin # Always overridden in inheriting class
0 commit comments