@@ -45,6 +45,12 @@ idlelib
45
45
# Module members that exist at runtime, but are deliberately missing from stubs
46
46
# =============================================================================
47
47
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
+
48
54
_collections_abc.Mapping.__reversed__ # set to None at runtime for a better error message
49
55
50
56
# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
@@ -211,8 +217,11 @@ _?ast.excepthandler.__init__
211
217
_?ast.expr.__init__
212
218
_?ast.stmt.__init__
213
219
220
+ _ast.ImportFrom.level # None on the class, but never None on instances
221
+
214
222
ast.Bytes.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
215
223
ast.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
216
225
ast.NameConstant.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
217
226
ast.Num.__new__ # runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
218
227
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
253
262
configparser.SectionProxy.getboolean # SectionProxy get functions are set in __init__
254
263
configparser.SectionProxy.getfloat # SectionProxy get functions are set in __init__
255
264
configparser.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
+
256
271
_?contextvars.Context.__init__ # C signature is broader than what is actually accepted
272
+
257
273
copy.PyStringMap # defined only in Jython
258
274
259
275
# 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
296
312
enum.auto.__or__ # enum.auto is magic, see comments
297
313
enum.auto.__and__ # enum.auto is magic, see comments
298
314
enum.auto.__xor__ # enum.auto is magic, see comments
315
+
316
+ functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
299
317
functools.cached_property.__set__ # doesn't exist, but cached_property is settable by another mechanism
318
+
300
319
_?hashlib.scrypt # Raises TypeError if salt, n, r or p are None
301
320
hmac.new # Raises TypeError if optional argument digestmod is not provided
302
321
http.HTTPStatus.description # set in __new__; work-around for enum wierdness
@@ -310,6 +329,7 @@ importlib._bootstrap_external.FileLoader.get_resource_reader
310
329
importlib._bootstrap_external.FileLoader.load_module
311
330
importlib.abc.FileLoader.get_filename
312
331
importlib.abc.FileLoader.load_module
332
+ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
313
333
importlib.machinery.ExtensionFileLoader.get_filename
314
334
315
335
# 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
377
397
378
398
numbers.Number.__hash__ # typeshed marks this as abstract but code just sets this as None
379
399
optparse.Values.__getattr__ # Some attributes are set in __init__ using setattr
400
+
380
401
os._wrap_close.read # Methods that come from __getattr__() at runtime
381
402
os._wrap_close.readable # Methods that come from __getattr__() at runtime
382
403
os._wrap_close.readline # Methods that come from __getattr__() at runtime
383
404
os._wrap_close.readlines # Methods that come from __getattr__() at runtime
384
405
os._wrap_close.writable # Methods that come from __getattr__() at runtime
385
406
os._wrap_close.write # Methods that come from __getattr__() at runtime
386
407
os._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
+
387
410
pickle._Pickler\..* # Best effort typing for undocumented internals
388
411
pickle._Unpickler\..* # Best effort typing for undocumented internals
389
412
_?queue.SimpleQueue.__init__ # C signature is broader than what is actually accepted
@@ -433,6 +456,11 @@ traceback.TracebackException.from_exception # explicitly expanding arguments go
433
456
turtle.ScrolledCanvas.find_all # Dynamically created, has unnecessary *args
434
457
turtle.ScrolledCanvas.select_clear # Dynamically created, has unnecessary *args
435
458
turtle.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
+
436
464
typing.type_check_only # typing decorator that is not available at runtime
437
465
438
466
# Details of runtime definition don't need to be in stubs
@@ -468,14 +496,14 @@ typing(_extensions)?\.Match
468
496
typing(_extensions)?\.MutableMapping
469
497
typing(_extensions)?\.MutableSequence
470
498
typing(_extensions)?\.MutableSet
499
+ typing(_extensions)?\.NamedTuple
471
500
typing(_extensions)?\.Pattern
472
501
typing(_extensions)?\.Reversible
473
502
typing(_extensions)?\.Sequence
474
503
typing(_extensions)?\.Sized
475
504
typing(_extensions)?\.ValuesView
476
505
typing_extensions\.Final
477
506
typing_extensions\.LiteralString
478
- typing_extensions\.NamedTuple
479
507
480
508
typing._SpecialForm.__call__ # Typing-related weirdness
481
509
typing._SpecialForm.__init__ # Typing-related weirdness
@@ -512,11 +540,14 @@ urllib.response.addbase.write # Methods that come from __getattr__() at runtime
512
540
urllib.response.addbase.writelines # Methods that come from __getattr__() at runtime
513
541
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to super, so super args are specified
514
542
unittest.mock.patch # function with attributes, which we approximate with a callable class
543
+
515
544
_?weakref\.CallableProxyType\.__getattr__ # Should have all attributes of proxy
516
545
_?weakref\.(ref|ReferenceType)\.__init__ # C implementation has incorrect signature
517
546
_?weakref\.(ref|ReferenceType)\.__call__ # C function default annotation is wrong
518
547
_?weakref\.ProxyType\.__getattr__ # Should have all attributes of proxy
548
+ _?weakref\.ProxyType\.__reversed__ # Doesn't really exist
519
549
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
550
+
520
551
webbrowser.UnixBrowser.remote_action # Always overridden in inheriting class
521
552
webbrowser.UnixBrowser.remote_action_newtab # Always overridden in inheriting class
522
553
webbrowser.UnixBrowser.remote_action_newwin # Always overridden in inheriting class
0 commit comments