clean up allowlists (#14612)

This commit is contained in:
Stephen Morton
2025-08-21 01:54:17 -07:00
committed by GitHub
parent f3f5cccc33
commit 9b5b3ecb0a
12 changed files with 155 additions and 132 deletions
@@ -1,6 +1,6 @@
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Added in Python 3.10.15
email._header_value_parser.NLSET
@@ -8,12 +8,11 @@ fcntl.F_OFD_SETLK
fcntl.F_OFD_SETLKW
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Incompatible changes introduced in Python 3.11.10
# (Remove once 3.11.10 becomes available for MacOS)
# Added in Python 3.11.10
email._header_value_parser.NLSET
email._header_value_parser.SPECIALSNL
email.errors.HeaderWriteError
@@ -1,6 +1,6 @@
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Added in Python 3.9.20
email._header_value_parser.NLSET
+12 -24
View File
@@ -70,22 +70,11 @@ importlib.metadata._meta.SimplePath.__truediv__ # Runtime definition of protoco
# ===================================
# ===========
# 3.9 to 3.10
# ===========
builtins.float.__setformat__ # Internal method for CPython test suite
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
# Will always raise. Not included to avoid type checkers inferring that
# Sentinel instances are callable.
typing_extensions.Sentinel.__call__
# =======
# <= 3.10
# =======
builtins.float.__setformat__ # Internal method for CPython test suite
email.contentmanager.typ
gettext.install # codeset default value is ['unspecified'] so can't be specified
gettext.translation # codeset default value is ['unspecified'] so can't be specified
@@ -100,6 +89,11 @@ tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable
tkinter.Tk.split # Exists at runtime, but missing from stubs
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
# Will always raise. Not included to avoid type checkers inferring that
# Sentinel instances are callable.
typing_extensions.Sentinel.__call__
# =======
@@ -212,13 +206,6 @@ importlib.metadata.DeprecatedList.sort
typing.ParamSpec(Args|Kwargs).__origin__
# =================================================================
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
# =================================================================
typing\.Annotated # Super-special typing primitive
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.10
# =============================================================
@@ -273,6 +260,11 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
# Incompatible changes introduced in Python 3.10.17
# (Remove once 3.10.17 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
@@ -317,11 +309,7 @@ sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details
# Incompatible changes introduced in Python 3.10.17
# (Remove once 3.10.17 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?
typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
+17 -11
View File
@@ -7,7 +7,6 @@
# >= 3.11
# =======
enum.Enum.__init__
typing.NewType.__mro_entries__
@@ -140,11 +139,17 @@ typing\.ByteString
typing_extensions.TypeAliasType.__call__
# ============
# 3.11 to 3.13
# ============
enum.Enum.__init__
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.11
# =============================================================
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
enum.auto.value # The stub for enum.auto is nothing like the implementation
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -198,11 +203,11 @@ importlib.metadata.DeprecatedList.sort
typing.ParamSpec(Args|Kwargs).__origin__
# =================================================================
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
# =================================================================
# ==================================================================
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
# ==================================================================
typing\.Annotated # Super-special typing primitive
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
# =============================================================
@@ -233,6 +238,11 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
# Incompatible changes introduced in Python 3.11.12
# (Remove once 3.11.12 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
@@ -277,11 +287,7 @@ sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details
# Incompatible changes introduced in Python 3.11.12
# (Remove once 3.11.12 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
(email._header_value_parser.make_quoted_pairs)?
typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
+24 -13
View File
@@ -7,15 +7,20 @@
# >= 3.12
# =======
# Initialized at runtime
typing_extensions.TypeAliasType.__parameters__
typing_extensions.TypeAliasType.__value__
# Types that require `__setattr__` and `__delattr__` for typing purposes:
types.SimpleNamespace.__setattr__
types.SimpleNamespace.__delattr__
# ============
# 3.12 to 3.13
# ============
# Initialized at runtime
typing_extensions.TypeAliasType.__parameters__
typing_extensions.TypeAliasType.__value__
# ====================================
# Pre-existing errors from Python 3.11
# ====================================
@@ -25,10 +30,16 @@ types.SimpleNamespace.__delattr__
# >= 3.11
# =======
enum.Enum.__init__
typing.NewType.__mro_entries__
# ============
# 3.11 to 3.13
# ============
enum.Enum.__init__
# =======
# >= 3.10
# =======
@@ -161,7 +172,6 @@ typing_extensions.SupportsRound.__type_params__
# Allowlist entries that cannot or should not be fixed; >= 3.11
# =============================================================
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
enum.auto.value # The stub for enum.auto is nothing like the implementation
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -171,6 +181,13 @@ typing\._SpecialForm.* # Super-special typing primitive
typing\.LiteralString # Super-special typing primitive
# ==================================================================
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
# ==================================================================
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.10
# =============================================================
@@ -202,13 +219,6 @@ ctypes._endian.SIZEOF_TIME_T # Incorrectly star import.
configparser.LegacyInterpolation.__init__ # runtime is *args, **kwargs, but it's just a passthrough
# =================================================================
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
# =================================================================
typing\.Annotated # Super-special typing primitive
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
# =============================================================
@@ -252,6 +262,7 @@ sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details
typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
+23 -6
View File
@@ -12,23 +12,34 @@
# >= 3.12
# =======
# Initialized at runtime
typing_extensions.TypeAliasType.__parameters__
typing_extensions.TypeAliasType.__value__
# Types that require `__setattr__` and `__delattr__` for typing purposes:
types.SimpleNamespace.__setattr__
types.SimpleNamespace.__delattr__
# ============
# 3.12 to 3.13
# ============
# Initialized at runtime
typing_extensions.TypeAliasType.__parameters__
typing_extensions.TypeAliasType.__value__
# =======
# >= 3.11
# =======
enum.Enum.__init__
typing.NewType.__mro_entries__
# ============
# 3.11 to 3.13
# ============
enum.Enum.__init__
# =======
# >= 3.10
# =======
@@ -151,7 +162,6 @@ typing_extensions.SupportsRound.__type_params__
# Allowlist entries that cannot or should not be fixed; >= 3.11
# =============================================================
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
enum.auto.value # The stub for enum.auto is nothing like the implementation
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -161,6 +171,13 @@ typing\._SpecialForm.* # Super-special typing primitive
typing\.LiteralString # Super-special typing primitive
# ==================================================================
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
# ==================================================================
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.10
# =============================================================
+44 -37
View File
@@ -13,11 +13,11 @@ multiprocessing.managers._BaseDictProxy.fromkeys
multiprocessing.process.BaseProcess.interrupt
multiprocessing.synchronize.SemLock.locked
# =========================
# New errors in Python 3.14
# =========================
# Union and UnionType are aliases in 3.14 but type checkers need some changes
typing_extensions.Union
typing.Union
@@ -38,6 +38,9 @@ concurrent.interpreters._crossinterp.UNBOUND_REMOVE
concurrent.interpreters._queues.UNBOUND_ERROR
concurrent.interpreters._queues.UNBOUND_REMOVE
importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
# ====================================
# Pre-existing errors from Python 3.13
# ====================================
@@ -65,7 +68,6 @@ typing.NewType.__mro_entries__
builtins.ellipsis # type is not exposed anywhere
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
importlib.util.Loader.exec_module
# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib
_collections_abc.Coroutine.send
@@ -93,6 +95,7 @@ typing(_extensions)?\.IO\.truncate
typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.14
# =============================================================
@@ -115,6 +118,45 @@ typing(_extensions)?\.IO\.writelines
(io|typing_extensions)\.Writer\.write
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
# But have more precise (accurate) signatures in the stub
multiprocessing.managers._BaseSetProxy.__iter__
multiprocessing.managers._BaseSetProxy.__len__
multiprocessing.managers._BaseSetProxy.clear
multiprocessing.managers._BaseSetProxy.copy
multiprocessing.managers._BaseSetProxy.pop
# Changes from patch releases to be introduced in Python 3.14.0b3
# (Remove once 3.14.0b3 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(tarfile.__all__)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
(_?hashlib.new)?
(_?hashlib.(openssl_)?md5)?
(_?hashlib.(openssl_)?sha1)?
(_?hashlib.(openssl_)?sha224)?
(_?hashlib.(openssl_)?sha256)?
(_?hashlib.(openssl_)?sha384)?
(_?hashlib.(openssl_)?sha3_224)?
(_?hashlib.(openssl_)?sha3_256)?
(_?hashlib.(openssl_)?sha3_384)?
(_?hashlib.(openssl_)?sha3_512)?
(_?hashlib.(openssl_)?sha512)?
(_?hashlib.(openssl_)?shake_128)?
(_?hashlib.(openssl_)?shake_256)?
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.13
# =============================================================
@@ -138,12 +180,6 @@ multiprocessing.managers._BaseDictProxy.keys
multiprocessing.managers._BaseDictProxy.popitem
multiprocessing.managers._BaseDictProxy.values
multiprocessing.managers._BaseSetProxy.__iter__
multiprocessing.managers._BaseSetProxy.__len__
multiprocessing.managers._BaseSetProxy.clear
multiprocessing.managers._BaseSetProxy.copy
multiprocessing.managers._BaseSetProxy.pop
# To match `dict`, we lie about the runtime, but use overloads to match the correct behavior
types.MappingProxyType.get
@@ -210,32 +246,3 @@ builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
importlib.metadata._meta.SimplePath.joinpath # Runtime definition of protocol is incorrect
# Changes from patch releases to be introduced in Python 3.14.0b3
# (Remove once 3.14.0b3 becomes available for all platforms)
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
(ntpath.ALLOW_MISSING)?
(os.path.__all__)?
(os.path.ALLOW_MISSING)?
(os.path.realpath)?
(posixpath.__all__)?
(posixpath.ALLOW_MISSING)?
(tarfile.__all__)?
(tarfile.LinkFallbackError)?
(tarfile.TarFile._extract_member)?
(tarfile.TarFile.makelink_with_filter)?
(_?hashlib.new)?
(_?hashlib.(openssl_)?md5)?
(_?hashlib.(openssl_)?sha1)?
(_?hashlib.(openssl_)?sha224)?
(_?hashlib.(openssl_)?sha256)?
(_?hashlib.(openssl_)?sha384)?
(_?hashlib.(openssl_)?sha3_224)?
(_?hashlib.(openssl_)?sha3_256)?
(_?hashlib.(openssl_)?sha3_384)?
(_?hashlib.(openssl_)?sha3_512)?
(_?hashlib.(openssl_)?sha512)?
(_?hashlib.(openssl_)?shake_128)?
(_?hashlib.(openssl_)?shake_256)?
+16 -21
View File
@@ -23,12 +23,12 @@ collections.Callable
collections.Mapping.get # Adding None to the Union messed up mypy
collections.Sequence.index # Supporting None in end is not mandatory
# ===========
# =======
# <= 3.10
# ===========
# =======
builtins.float.__setformat__ # Internal method for CPython test suite
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
email.contentmanager.typ
gettext.install # codeset default value is ['unspecified'] so can't be specified
gettext.translation # codeset default value is ['unspecified'] so can't be specified
@@ -43,6 +43,7 @@ tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable
tkinter.Tk.split # Exists at runtime, but missing from stubs
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
# Will always raise. Not included to avoid type checkers inferring that
# Sentinel instances are callable.
@@ -60,6 +61,8 @@ urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to
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
platform.platform # runtime default is 0, we pretend it's a bool
# =======
# <= 3.12
@@ -129,18 +132,6 @@ typing_extensions.TypeAliasType.__call__
ast.FormattedValue.conversion # None on the class, but never None on instances
_ast.FormattedValue.conversion # None on the class, but never None on instances
# =================================================================
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
# =================================================================
typing\.Annotated # Super-special typing primitive
# ============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.9
# ============================================================
_ssl.RAND_egd # Depends on the existence and flags of SSL
builtins.classmethod.__get__ # Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
builtins.property.__get__ # Runtime signature is incorrect (https://github.com/python/cpython/issues/93021)
@@ -193,6 +184,7 @@ sqlite3\.test\..+ # Modules that exist at runtime, but shouldn't be added to ty
tkinter.EventType.__new__ # Derives from (str, Enum)
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.11
# =============================================================
@@ -221,7 +213,14 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
platform.platform # runtime default is 0, we pretend it's a bool
# Incompatible changes introduced in Python 3.9.22
# (Remove once 3.9.22 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
# Incompatible changes introduced in Python 3.9.23
# (Remove once 3.9.23 becomes available for all platforms)
(email._header_value_parser.make_quoted_pairs)?
# =============================================================
# Allowlist entries that cannot or should not be fixed; <= 3.12
@@ -266,10 +265,7 @@ sunau.Au_write.initfp
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
typing_extensions\.Annotated # Undocumented implementation details
# Incompatible changes introduced in Python 3.9.22
# (Remove once 3.9.22 becomes available for all platforms)
(email._header_value_parser.get_encoded_word)?
typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
@@ -279,7 +275,6 @@ pickle.Unpickler.persistent_load
# Incompatible changes introduced in Python 3.9.23
# (Remove once 3.9.23 becomes available for all platforms)
(email._header_value_parser.make_quoted_pairs)?
(genericpath.__all__)?
(genericpath.ALLOW_MISSING)?
(ntpath.__all__)?
@@ -1,6 +1,6 @@
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Incompatible changes introduced in Python 3.10.15
# (Remove once 3.10.15 becomes available for Windows)
@@ -1,6 +1,6 @@
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Incompatible changes introduced in Python 3.11.10
# (Remove once 3.11.10 becomes available for Windows)
@@ -1,6 +1,6 @@
# ===========
# 3.9 to 3.11
# ===========
# =======
# <= 3.11
# =======
# Incompatible changes introduced in Python 3.9.20
# (Remove once 3.9.20 becomes available for Windows)