Bump mypy to 1.9, add to json.encoder, small fixups (#11549)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Shantanu
2024-03-09 14:25:00 -08:00
committed by GitHub
parent 5b1fd121e0
commit 4d8ae17776
40 changed files with 71 additions and 90 deletions

View File

@@ -65,8 +65,3 @@ curses.COLORS # Initialized after start_color
curses.COLOR_PAIRS # Initialized after start_color
curses.COLS # Initialized only after initscr call
curses.LINES # Initialized only after initscr call
# Takes a "_warn" parameter at runtime
# for technical reasons; no need to expose it in the stub.
asyncio.ThreadedChildWatcher.__del__
asyncio.unix_events.ThreadedChildWatcher.__del__

View File

@@ -53,8 +53,3 @@ curses.COLORS # Initialized after start_color
curses.COLOR_PAIRS # Initialized after start_color
curses.COLS # Initialized only after initscr call
curses.LINES # Initialized only after initscr call
# Takes a "_warn" parameter at runtime
# for technical reasons; no need to expose it in the stub.
asyncio.ThreadedChildWatcher.__del__
asyncio.unix_events.ThreadedChildWatcher.__del__

View File

@@ -7,6 +7,7 @@ bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signat
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

View File

@@ -125,7 +125,3 @@ typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__
typing_extensions.SupportsAbs.__type_params__
typing_extensions.SupportsRound.__type_params__
# Dunder that exists on all runtime-checkable protocols on py312+
# TODO teach stubtest about this so we don't have to allowlist it
.+\.__non_callable_proto_members__

View File

@@ -35,13 +35,13 @@ dummy_threading.Condition.release
dummy_threading.Event.isSet
dummy_threading.Thread.native_id
dummy_threading.local.__new__
email.contentmanager.typ
enum.Enum._generate_next_value_
gettext.install # codeset default value is ['unspecified'] so can't be specified
gettext.translation # codeset default value is ['unspecified'] so can't be specified
importlib.abc.Finder.find_module
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
random.Random.randrange # missing undocumented arg _int
sched.Event.__doc__ # __slots__ is overridden
typing.NamedTuple.__new__
typing.NamedTuple._asdict

View File

@@ -21,6 +21,7 @@ collections.ValuesView.__reversed__
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

View File

@@ -371,10 +371,6 @@ threading.Condition.release
multiprocessing.dummy.Condition.acquire
multiprocessing.dummy.Condition.release
# Takes a "_warn" parameter at runtime
# for technical reasons; no need to expose it in the stub.
asyncio.proactor_events._ProactorBasePipeTransport.__del__
# Weird special builtins that are typed as functions, but aren't functions
builtins.copyright
builtins.credits
@@ -450,6 +446,8 @@ multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ # Any field can be se
# mypy infers the variable has type `(*args) -> ForkingPickler`
# but stubtest infers the runtime type as <class ForkingPickler>
multiprocessing.reduction.AbstractReducer.ForkingPickler
# Non-private parameter on __del__
multiprocessing.pool.Pool.__del__
# C signature is broader than what is actually accepted
queue.SimpleQueue.__init__
@@ -519,9 +517,6 @@ _typeshed.* # Utility types for typeshed, doesn't exist at runtime
typing._SpecialForm.__call__
typing._SpecialForm.__init__
# Should go away with a future version of stubtest
typing_extensions\..*\.__non_callable_proto_members__
# Pretend typing.ByteString is a Union, to better match its documented semantics.
# As a side effect, this changes the definition of collections.abc.ByteString, which is okay,
# because it's not an ABC that makes any sense and was deprecated in 3.12
@@ -567,6 +562,10 @@ turtle.ScrolledCanvas.find_all
turtle.ScrolledCanvas.select_clear
turtle.ScrolledCanvas.select_item
# Attributes that are intended to be private
uuid.bytes_
uuid.int_
# Always overridden in inheriting class
webbrowser.UnixBrowser.remote_action
webbrowser.UnixBrowser.remote_action_newtab
@@ -705,13 +704,3 @@ typing(_extensions)?\.IO\.__iter__ # See https://github.com/python/typeshed/com
(tarfile.AbsolutePathError)?
(tarfile.AbsoluteLinkError)?
(shutil.unpack_archive)?
# Omit internal _KEEP argument
tarfile.TarInfo.replace
# Private parameters are deliberately omitted in the stubs (see https://github.com/python/mypy/issues/16443)
asyncio.(base_events.)?BaseEventLoop.__del__
asyncio.(base_subprocess.)?BaseSubprocessTransport.__del__
asyncio.(sslproto.)?_SSLProtocolTransport.__del__
multiprocessing.pool.Pool.__del__
subprocess.Popen.__del__

View File

@@ -1,3 +1,5 @@
tarfile.TarInfo.replace
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount

View File

@@ -1,3 +1,5 @@
tarfile.TarInfo.replace
# ==========
# Allowlist entries that cannot or should not be fixed
# ==========

View File

@@ -1,3 +1,5 @@
tarfile.TarInfo.replace
# pathlib methods that exist on Windows, but always raise NotImplementedError,
# so are omitted from the stub
pathlib.Path.is_mount

View File

@@ -60,7 +60,3 @@ pathlib.Path.group
# but have yet to find their way to all GitHub Actions images
(sys.get_int_max_str_digits)?
(sys.set_int_max_str_digits)?
# Takes a "_warn" parameter at runtime
# for technical reasons; no need to expose it in the stub.
asyncio.windows_utils.PipeHandle.__del__