_collections_abc.AsyncGenerator.athrow  # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also.
_weakref.ProxyType.__reversed__  # Doesn't really exist
asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
builtins.float.__setformat__  # Internal method for CPython test suite
builtins.property.__set_name__  # Doesn't actually exist
bz2.BZ2Decompressor.__init__  # function does not accept parameters but C signature is set
collections\.UserList\.index  # ignoring pos-or-keyword parameter
configparser.ParsingError.filename
contextlib.AbstractAsyncContextManager.__class_getitem__
contextlib.AbstractContextManager.__class_getitem__
email.contentmanager.typ
enum.Enum._generate_next_value_
functools._lru_cache_wrapper.cache_parameters  # Cannot be detected statically
gettext.install
gettext.translation
importlib._abc.Loader.exec_module  # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
importlib.abc.Finder.find_module
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
lib2to3.pgen2.grammar.Grammar.loads
# platform.uname_result's processor field is now dynamically made to exist
platform.uname_result.__match_args__
platform.uname_result.__new__
platform.uname_result.processor
tkinter.Tk.split
tkinter.tix.[A-Z_]+
tkinter.tix.TclVersion
tkinter.tix.TkVersion
tkinter.tix.CObjView
tkinter.tix.DialogShell
tkinter.tix.ExFileSelectDialog
tkinter.tix.FileSelectDialog
tkinter.tix.FileTypeList
tkinter.tix.Grid
tkinter.tix.NoteBookFrame
tkinter.tix.OptionName
tkinter.tix.ResizeHandle
tkinter.tix.ScrolledGrid
tkinter.tix.ScrolledHList
tkinter.tix.ScrolledListBox
tkinter.tix.ScrolledTList
tkinter.tix.ScrolledText
tkinter.tix.ScrolledWindow
tkinter.tix.Shell
types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
types.GenericAlias.__call__  # Would be complicated to fix properly, Any could silence problems. #6392
typing._SpecialForm.__mro_entries__
weakref.ProxyType.__reversed__  # Doesn't really exist
builtins.ellipsis  # type is not exposed anywhere

xml.etree.ElementTree.Element.__bool__  # Doesn't really exist; see comments in stub
xml.etree.cElementTree.Element.__bool__  # Doesn't really exist; see comments in stub

# Runtime definition of protocol is incorrect
importlib.metadata._meta.SimplePath.__truediv__
importlib.metadata._meta.SimplePath.joinpath

# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+
lib2to3.tests
lib2to3\.tests\..+
sqlite3.test
sqlite3\.test\..+
tkinter.test
tkinter\.test\..+
unittest.test
unittest\.test\..+

# Exist at runtime for internal reasons, no need to put them in the stub
typing_extensions\.TypeAliasType\.__call__
typing_extensions\.TypeAliasType\.__init_subclass__
# We call them read-only properties, runtime implementation is slightly different
typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__

# Runtime has *args, **kwargs, but will error if any are supplied
unittest.TestCase.__init_subclass__
unittest.case.TestCase.__init_subclass__

# SpooledTemporaryFile implements IO except these methods before Python 3.11
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
tempfile.SpooledTemporaryFile.readable
tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable

# The "loop" argument exists at runtime,
# but raises TypeError if you try to provide any value for it
asyncio.BoundedSemaphore.__init__
asyncio.Condition.__init__
asyncio.Event.__init__
asyncio.Lock.__init__
asyncio.Queue.__init__
asyncio.Semaphore.__init__
asyncio.locks.BoundedSemaphore.__init__
asyncio.locks.Semaphore.__init__
asyncio.locks.Condition.__init__
asyncio.locks.Event.__init__
asyncio.locks.Lock.__init__
asyncio.locks.Semaphore.__init__
asyncio.queues.Queue.__init__

# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__
_collections_abc.Container.__class_getitem__
_collections_abc.Iterable.__class_getitem__
_collections_abc.MappingView.__class_getitem__
_csv.Reader
_csv.Writer
bdb.Breakpoint.clearBreakpoints
inspect.Signature.from_builtin  # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function  # Removed in 3.11, can add if someone needs this
lib2to3.btm_utils
lib2to3.fixer_util
lib2to3.patcomp

# ==========
# Related to positional-only arguments
# ==========

# These are not positional-only at runtime, but we treat them
# as positional-only to match dict.
_collections_abc.MutableMapping.pop
_collections_abc.MutableMapping.setdefault

# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
# to mark these as positional-only for compatibility with existing sub-classes.
typing(_extensions)?\.BinaryIO\.write
typing(_extensions)?\.IO\.read
typing(_extensions)?\.IO\.readline
typing(_extensions)?\.IO\.readlines
typing(_extensions)?\.IO\.seek
typing(_extensions)?\.IO\.truncate
typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines

# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
_collections_abc.Coroutine.send
_collections_abc.Coroutine.throw
_collections_abc.Generator.send
_collections_abc.Generator.throw

# typing.SupportsRound.__round__  # pos-or-kw at runtime, but we pretend it's pos-only in the stub so that e.g. float.__round__ satisfies the interface
types.DynamicClassAttribute..*  # In the stub we pretend it's an alias for property, but it has positional-only differences

# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
posixpath.join
ntpath.join
os.path.join

# ==========
# Allowlist entries that cannot or should not be fixed
# ==========

# Factory function at runtime
# but that wouldn't let us use it in type hints
threading.Lock
multiprocessing.dummy.Lock

# Runtime AST node runtime constructor behaviour is too loose.
# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378).
# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858)
_?ast.pattern.__init__

# more precise signature in the stubs than at runtime
multiprocessing.managers.DictProxy.clear
multiprocessing.managers.DictProxy.popitem

# Side effects from module initialization
_compat_pickle.excname
email.contentmanager.maintype
email.contentmanager.subtype
inspect.k
inspect.mod_dict
inspect.v
json.encoder.i
lib2to3.pgen2.grammar.line
lib2to3.pgen2.grammar.name
lib2to3.pgen2.grammar.op
poplib.POP3_SSL.stls  # bad declaration of inherited function. See poplib.pyi
pydoc.Helper.symbol  # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.symbols_  # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.topic  # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522

# Undocumented implementation details
cgi.FieldStorage.bufsize
cgi.FieldStorage.read_binary
cgi.FieldStorage.read_lines
cgi.FieldStorage.read_lines_to_eof
cgi.FieldStorage.read_lines_to_outerboundary
cgi.FieldStorage.read_multi
cgi.FieldStorage.read_single
cgi.FieldStorage.read_urlencoded
cgi.FieldStorage.skip_lines
pipes.Template.makepipeline
pipes.Template.open_r
pipes.Template.open_w
sunau.Au_read.initfp
sunau.Au_write.initfp
typing_extensions\.Annotated

# C signature is broader than what is actually accepted
ast.ExtSlice.__new__
ast.Index.__new__

os.PathLike.__class_getitem__  # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem
_ast.ImportFrom.level  # None on the class, but never None on instances
ast.ImportFrom.level  # None on the class, but never None on instances

# White lies around defaults
dataclasses.KW_ONLY

# We pretend it's a read-only property for forward compatibility with 3.12
typing.ParamSpec(Args|Kwargs).__origin__

# Problematic protocol signatures at runtime, see source code comments.
importlib.abc.Traversable.joinpath
importlib.abc.Traversable.open

# Deprecation wrapper classes; their methods are just pass-through, so we can ignore them.
importlib.metadata.DeprecatedList.reverse
importlib.metadata.DeprecatedList.sort

# Super-special typing primitives
typing\.NamedTuple
typing\.Annotated

# We lie about the existence of these methods
.*.__buffer__
.*.__release_buffer__

# Removed in 3.12
distutils\..*
asyncore.dispatcher.addr
asyncore.dispatcher.handle_accepted
asynchat.async_chat.encoding
asynchat.async_chat.use_encoding
asynchat.find_prefix_at_end
pkgutil.ImpImporter\..*
pkgutil.ImpLoader\..*

types.CodeType.replace  # stubtest thinks default values are None but None doesn't work at runtime
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature

# These enums derive from (str, Enum)
pstats.SortKey.__new__
tkinter.EventType.__new__

# Incorrectly star import.
ctypes._endian.DEFAULT_MODE
ctypes._endian.RTLD_GLOBAL
ctypes._endian.RTLD_LOCAL
