_collections_abc.Callable  # Some typecheckers need this as specialform
# Coroutine and Generator properties are added programmatically
_collections_abc.Coroutine.cr_await
_collections_abc.Coroutine.cr_code
_collections_abc.Coroutine.cr_frame
_collections_abc.Coroutine.cr_running
_collections_abc.Generator.gi_code
_collections_abc.Generator.gi_frame
_collections_abc.Generator.gi_running
_collections_abc.Generator.gi_yieldfrom
_collections_abc.Mapping.get  # Adding None to the Union messed up mypy
_collections_abc.Sequence.index  # Supporting None in end is not mandatory
_csv.Dialect.__init__  # C __init__ signature is inaccurate
_dummy_threading
_socket.*
_threading_local.local.__new__
_typeshed.*  # Utility types for typeshed, doesn't exist at runtime
abc.abstractclassmethod
abc.abstractstaticmethod
abc.ABCMeta.__new__  # pytype wants the parameter named cls and not mcls
_weakref.CallableProxyType.__getattr__  # Should have all attributes of proxy
_weakref.ProxyType.__getattr__  # Should have all attributes of proxy
_weakref.ReferenceType.__call__  # C function default annotation is wrong
argparse.Namespace.__getattr__  # The whole point of this class is its attributes are dynamic
asyncio.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
# Condition functions are exported in __init__
asyncio.Condition.acquire
asyncio.Condition.locked
asyncio.Condition.release
asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
# Condition functions are exported in __init__
asyncio.locks.Condition.acquire
asyncio.locks.Condition.locked
asyncio.locks.Condition.release
asyncio.proactor_events.BaseProactorEventLoop.sock_recv # nbytes parameter has different name 'n' in implementation
asyncio.selector_events.BaseSelectorEventLoop.sock_recv # nbytes parameter has different name 'n' in implementation
builtins.classmethod.__get__  # this function can accept no value for the type parameter.
builtins.ellipsis  # type is not exposed anywhere
builtins.function
builtins.memoryview.__contains__  # C type that implements __getitem__
builtins.object.__init__  # default C signature is incorrect
builtins.property.__get__  # this function can accept no value for the type parameter.
builtins.staticmethod.__get__  # this function can accept no value for the type parameter.
bz2.BZ2Decompressor.__init__  # function does not accept parameters but C signature is set
# The following CodecInfo properties are added in __new__
codecs.CodecInfo.decode
codecs.CodecInfo.encode
codecs.CodecInfo.incrementaldecoder
codecs.CodecInfo.incrementalencoder
codecs.CodecInfo.streamreader
codecs.CodecInfo.streamwriter
# Coroutine and Generator properties are added programmatically
collections.ChainMap.get  # Adding None to the underlying Mapping Union messed up mypy
# Coroutine and Generator properties are added programmatically
collections.abc.Coroutine.cr_await
collections.abc.Coroutine.cr_code
collections.abc.Coroutine.cr_frame
collections.abc.Coroutine.cr_running
collections.abc.Generator.gi_code
collections.abc.Generator.gi_frame
collections.abc.Generator.gi_running
collections.abc.Generator.gi_yieldfrom
configparser.SectionProxy.__getattr__  # SectionProxy can have arbitrary attributes when custom converters are used
# SectionProxy get functions are set in __init__
configparser.SectionProxy.getboolean
configparser.SectionProxy.getfloat
configparser.SectionProxy.getint
copy.PyStringMap  # defined only in Jython
# The Dialect properties are initialized as None in Dialect but their values are enforced in _Dialect
csv.Dialect.delimiter
csv.Dialect.doublequote
csv.Dialect.lineterminator
csv.Dialect.quoting
csv.Dialect.skipinitialspace
ctypes.Array.__iter__  # mypy doesn't support using __getitem__ instead of __iter__ so this is here https://github.com/python/mypy/issues/2220
ctypes.CDLL._FuncPtr  # None at class level but initialized in __init__ to this value
ctypes.memmove  # CFunctionType
ctypes.memset  # CFunctionType
ctypes.pointer  # imported C function
ctypes.string_at  # docstring argument name is wrong
ctypes.wstring_at  # docstring argument name is wrong
difflib.SequenceMatcher.__init__  # mypy default value for generic parameter issues. See https://github.com/python/mypy/issues/3737
distutils.command.bdist_packager  # It exists in docs as package name but not in code except as a mention in a comment.
distutils.version.Version._cmp  # class should have declared this
distutils.version.Version.parse  # class should have declared this
email.headerregistry.BaseHeader.max_count  # docs say subclasses should have this property
enum.EnumMeta.__call__
enum.EnumMeta.__new__
http.HTTPStatus.description  # set in __new__
http.HTTPStatus.phrase  # set in __new__
http.client.HTTPConnection.response_class  # the actual type at runtime is abc.ABCMeta
imaplib.IMAP4_SSL.ssl  # Dependent on SSL existence
importlib.abc.FileLoader.get_filename  # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.FileLoader.load_module  # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.Loader.exec_module  # See Lib/importlib/_abc.py. Might be defined for backwards compatability
importlib.abc.MetaPathFinder.find_spec  # Not defined on the actual class, but expected to exist.
importlib.abc.PathEntryFinder.find_spec  # Not defined on the actual class, but expected to exist.
importlib.machinery.ExtensionFileLoader.get_filename  # Wrapped with _check_name decorator which changes runtime signature
inspect.Parameter.empty  # set as private marker _empty
inspect.Parameter.KEYWORD_ONLY
inspect.Parameter.POSITIONAL_ONLY
inspect.Parameter.POSITIONAL_OR_KEYWORD
inspect.Parameter.VAR_KEYWORD
inspect.Parameter.VAR_POSITIONAL
inspect.Signature.empty  # set as private marker _empty
io.BufferedRandom.truncate
io.BufferedReader.seek
io.BufferedReader.truncate
io.BufferedWriter.seek
io.BufferedWriter.truncate
io.BytesIO.readlines
io.BytesIO.seek  # Parameter name for a positional-only param differs from its name in the inherited method
io.FileIO.seek
io.StringIO.seek
io.StringIO.truncate
io.TextIOWrapper.truncate
ipaddress._BaseAddress.is_global
ipaddress._BaseAddress.is_link_local
ipaddress._BaseAddress.is_loopback
ipaddress._BaseAddress.is_multicast
ipaddress._BaseAddress.is_private
ipaddress._BaseAddress.is_reserved
ipaddress._BaseAddress.is_unspecified
ipaddress._BaseAddress.max_prefixlen
ipaddress._BaseAddress.packed
ipaddress._BaseNetwork.max_prefixlen
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
mmap.mmap.__iter__  # has __getitem__ but mypy doesn't derive __iter__ from it: https://github.com/python/mypy/issues/2220
multiprocessing.JoinableQueue
multiprocessing.Queue
multiprocessing.SimpleQueue
multiprocessing.managers.BaseManager.shutdown
multiprocessing.managers.SyncManager.Event
multiprocessing.managers.SyncManager.Lock
multiprocessing.managers.SyncManager.Namespace
multiprocessing.managers.SyncManager.RLock
multiprocessing.queues.JoinableQueue.__init__
multiprocessing.queues.Queue.__init__
multiprocessing.queues.Queue.put_nowait
multiprocessing.queues.SimpleQueue.__init__
multiprocessing.queues.SimpleQueue.put
multiprocessing.synchronize.Barrier.__init__
multiprocessing.synchronize.Condition.acquire
multiprocessing.synchronize.Condition.release
multiprocessing.synchronize.Event.__init__
multiprocessing.synchronize.SemLock.__init__
multiprocessing.synchronize.SemLock.acquire
multiprocessing.synchronize.SemLock.release
numbers.Number.__hash__  # typeshed marks this as abstract but code just sets this as None
optparse.Values.__getattr__  # Some attributes are set in __init__ using setattr
pickle.Pickler.persistent_id  # C pickler persistent_id is an attribute
pickle.Unpickler.persistent_load  # C unpickler persistent_load is an attribute
poplib.POP3_SSL.stls  # bad declaration of inherited function. See poplib.pyi
pydoc.HTMLDoc.docdata
pydoc.HTMLDoc.docproperty
pydoc.HTMLDoc.docroutine
pydoc.TextDoc.docdata
pydoc.TextDoc.docmodule
pydoc.TextDoc.docother
pydoc.TextDoc.docproperty
pydoc.TextDoc.docroutine
select.poll  # Depends on configuration
selectors.DevpollSelector  # Depends on configuration
socketserver.BaseServer.fileno  # implemented in derived classes
socketserver.BaseServer.get_request  # implemented in derived classes
socketserver.BaseServer.server_bind  # implemented in derived classes
ssl.PROTOCOL_SSLv2  # Defined only if compiled with ssl v2
ssl.Purpose.__new__  # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
ssl._ASN1Object.__new__  # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
subprocess.Popen.__init__
sys.gettotalrefcount  # Available on python debug builds
sys.implementation  # Actually SimpleNamespace but then you wouldn't have convenient attributes
tarfile.TarFile.errors  # errors is initialized for some reason as None even though it really only accepts str
# SpooledTemporaryFile implements IO except these methods
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
tempfile.SpooledTemporaryFile.readable
tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable
threading.Condition.acquire  # Condition functions are exported in __init__
threading.Condition.release  # Condition functions are exported in __init__
threading.Lock  # A factory function that returns 'most efficient lock'. Marking it as a function will make it harder for users to mark the Lock type.
tkinter.Misc.grid_propagate  # The noarg placeholder is a set value list
tkinter.Misc.pack_propagate  # The noarg placeholder is a set value list
tkinter.Misc.grid_columnconfigure  # an empty dict literal is actually a valid default for a TypedDict(total=False) parameter
tkinter.Misc.grid_rowconfigure  # an empty dict literal is actually a valid default for a TypedDict(total=False) parameter
tkinter.Tk.eval  # from __getattr__
tkinter.Tk.report_callback_exception  # A bit of a lie, since it's actually a method, but typing it as an attribute allows it to be assigned to
tkinter.Wm.wm_iconphoto  # Default value of argument can't be used without runtime error
tkinter.font.Font.__getitem__  # Argument name differs (doesn't matter for __dunder__ methods)
traceback.TracebackException.from_exception  # explicitly expanding arguemnts going into TracebackException __init__
types.GetSetDescriptorType.__get__  # this function can accept no value for the type parameter.
types.MemberDescriptorType.__get__  # this function can accept no value for the type parameter.
types.SimpleNamespace.__init__  # class doesn't accept positional arguments but has default C signature
typing.IO.__iter__  # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
typing.IO.__next__  # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
typing.type_check_only  # typing decorator that is not available at runtime
unittest.mock.patch  # It's a complicated overload and I haven't been able to figure out why stubtest doesn't like it
urllib.parse._DefragResultBase.__new__  # Generic NamedTuple is problematic in mypy, so regular tuple was used. See https://github.com/python/mypy/issues/685
urllib.request.HTTPPasswordMgrWithPriorAuth.__init__  # Args are passed as is to super, so super args are specified
warnings.catch_warnings.__init__  # Defining this ruins the __new__ overrides
weakref.CallableProxyType.__getattr__  # Should have all attributes of proxy
weakref.ProxyType.__getattr__  # Should have all attributes of proxy
weakref.ReferenceType.__call__  # C function default annotation is wrong
weakref.WeakKeyDictionary.get
weakref.WeakKeyDictionary.update
weakref.WeakValueDictionary.get
webbrowser.UnixBrowser.remote_action  # always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newtab  # always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newwin  # always overridden in inheriting class
wsgiref.types  # Doesn't exist, see comments in file

# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
_pydecimal.*  # See comments in file
ast.NodeVisitor.visit_\w+  # Methods are discovered dynamically, see #3796
# Weird special builtins that are typed as functions, but aren't functions
builtins.copyright
builtins.credits
builtins.exit
builtins.help
builtins.license
builtins.quit
# Builtins that mypy pretends exist
builtins.reveal_locals
builtins.reveal_type
collections.abc.*  # Types are re-exported from _collections_abc, so errors should be fixed there
distutils.command.check.SilentReporter  # only defined if docutils in installed
# Dynamically specified by __getattr__, and thus don't exist on the class
tempfile._TemporaryFileWrapper.[\w_]+
# Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined.
typing.[A-Z]\w+
typing_extensions\..*
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty
inspect.Parameter.__init__
inspect.Signature.__init__
# Any field can be set on Namespace
multiprocessing.(dummy|managers).Namespace.__[gs]etattr__
os.[a-z]+_(param|result)._(asdict|make|replace)  # NamedTuple like, but not actually NamedTuples
# sys attributes that are not always defined
sys.last_traceback
sys.last_type
sys.last_value
sys.ps1
sys.ps2
sys.tracebacklimit
# See comments in file. List out methods that are delegated by __getattr__ at runtime.
# Used to make the relevant class satisfy BinaryIO interface.
codecs.StreamReaderWriter.\w+
codecs.StreamRecoder.\w+
urllib.response.addbase.\w+

# Platform differences that cannot be captured by the type system
errno.[A-Z0-9]+
os.O_[A-Z_]+
(posix.O_[A-Z_]+)?
(posix.ST_[A-Z]+)?
socket.AF_DECnet
socket.[A-Z0-9_]+
(termios.[A-Z0-9_]+)?
