44
55# Please keep sorted alphabetically
66
7- collections\.ChainMap\.fromkeys # https://github.com/python/mypy/issues/17023
8- http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta
97importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
108importlib.abc.MetaPathFinder.find_spec # Not defined on the actual class, but expected to exist.
119importlib.abc.PathEntryFinder.find_spec # Not defined on the actual class, but expected to exist.
1210tkinter.simpledialog.[A-Z_]+
1311tkinter.simpledialog.TclVersion
1412tkinter.simpledialog.TkVersion
15- tkinter.Text.count # stubtest somehow thinks that index1 parameter has a default value, but it doesn't in any of the overloads
13+ tarfile.TarInfo.__slots__ # it's a big dictionary at runtime and the dictionary values are a bit long
1614
1715
1816# ===============================================================
@@ -183,6 +181,12 @@ _collections_abc.AsyncGenerator.__anext__
183181_collections_abc.AsyncGenerator.aclose
184182_collections_abc.AsyncIterator.__anext__
185183
184+ # Pretend typing.ByteString is a Union, to better match its documented semantics.
185+ # As a side effect, this changes the definition of collections.abc.ByteString, which is okay,
186+ # because it's not an ABC that makes any sense and was deprecated in 3.12
187+ _collections_abc\.ByteString
188+ typing\.ByteString
189+
186190_collections_abc.Callable # Typing-related weirdness
187191_collections_abc.Mapping.get # Adding None to the Union messed up mypy
188192_collections_abc.Sequence.index # Supporting None in end is not mandatory
@@ -201,7 +205,6 @@ _markupbase.ParserBase.parse_marked_section
201205
202206_pydecimal.* # See comments in file
203207_typeshed.* # Utility types for typeshed, doesn't exist at runtime
204- argparse.ArgumentParser.__init__ # stubtest doesn't recognise the runtime default (a class) as being compatible with a callback protocol (the stub annotation)
205208argparse.Namespace.__getattr__ # The whole point of this class is its attributes are dynamic
206209
207210# Runtime AST node runtime constructor behaviour is too loose.
@@ -218,8 +221,6 @@ argparse.Namespace.__setattr__ # should allow setting any attribute
218221
219222ast.ImportFrom.level # None on the class, but never None on instances
220223ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796
221- _?asyncio.Future.__init__ # Usually initialized from c object
222- asyncio.futures.Future.__init__ # Usually initialized from c object
223224
224225# Condition functions are exported in __init__
225226asyncio.Condition.acquire
@@ -230,7 +231,6 @@ asyncio.locks.Condition.locked
230231asyncio.locks.Condition.release
231232
232233builtins.memoryview.__contains__ # C type that implements __getitem__
233- builtins.object.__init__ # default C signature is incorrect
234234builtins.reveal_locals # Builtins that type checkers pretends exist
235235builtins.reveal_type # Builtins that type checkers pretends exist
236236builtins.type.__dict__ # read-only but not actually a property; stubtest thinks it's a mutable attribute.
@@ -260,8 +260,6 @@ configparser.SectionProxy.getint # SectionProxy get functions are set in __init
260260contextlib.AbstractAsyncContextManager.__class_getitem__
261261contextlib.AbstractContextManager.__class_getitem__
262262
263- _?contextvars.Context.__init__ # C signature is broader than what is actually accepted
264-
265263copy.PyStringMap # defined only in Jython
266264
267265# The Dialect properties are initialized as None in Dialect but their values are enforced in _Dialect
@@ -329,9 +327,6 @@ importlib.machinery.ExtensionFileLoader.get_filename
329327inspect.Parameter.__init__
330328inspect.Signature.__init__
331329
332- inspect.Parameter.empty # set as private marker _empty
333- inspect.Signature.empty # set as private marker _empty
334-
335330logging.LogRecord.__setattr__ # doesn't exist, but makes things easy if we pretend it does
336331
337332# Iterable classes that don't define __iter__ at runtime (usually iterable via __getitem__)
@@ -377,11 +372,6 @@ multiprocessing.queues.JoinableQueue.__init__
377372multiprocessing.queues.Queue.__init__
378373multiprocessing.queues.SimpleQueue.__init__
379374
380- # alias for a class defined elsewhere,
381- # mypy infers the variable has type `(*args) -> ForkingPickler`
382- # but stubtest infers the runtime type as <class ForkingPickler>
383- multiprocessing.reduction.AbstractReducer.ForkingPickler
384-
385375# These methods are dynamically created after object initialization,
386376# copied from a wrapped lock object. Stubtest doesn't think they exist
387377# because of that.
@@ -406,7 +396,6 @@ os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all Pat
406396
407397pickle._Pickler\..* # Best effort typing for undocumented internals
408398pickle._Unpickler\..* # Best effort typing for undocumented internals
409- _?queue.SimpleQueue.__init__ # C signature is broader than what is actually accepted
410399shutil.rmtree # function with attributes, which we approximate with a callable protocol
411400socketserver.BaseServer.get_request # Not implemented, but expected to exist on subclasses.
412401ssl.PROTOCOL_SSLv2 # Depends on the existence and flags of SSL
@@ -466,7 +455,6 @@ typing._Final.__init_subclass__
466455typing\.Protocol
467456typing(_extensions)?\._TypedDict
468457typing(_extensions)?\.Any.*
469- typing(_extensions)?\.Generic
470458typing(_extensions)?\.TypedDict
471459typing_extensions\.ParamSpec.*
472460typing_extensions\.TypeVar.*
0 commit comments