[ty] Sync vendored typeshed stubs (#20394)

Close and reopen this PR to trigger CI

---------

Co-authored-by: typeshedbot <>
Co-authored-by: David Peter <mail@david-peter.de>
This commit is contained in:
github-actions[bot] 2025-09-15 09:30:28 +02:00 committed by GitHub
parent 9e4acd8bdd
commit 276ee1bb1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 53 additions and 39 deletions

View File

@ -409,13 +409,13 @@ f(**kwargs<CURSOR>)
assert_snapshot!(test.goto_type_definition(), @r#"
info[goto-type-definition]: Type definition
--> stdlib/builtins.pyi:2917:7
--> stdlib/builtins.pyi:2916:7
|
2916 | @disjoint_base
2917 | class dict(MutableMapping[_KT, _VT]):
2915 | @disjoint_base
2916 | class dict(MutableMapping[_KT, _VT]):
| ^^^^
2918 | """dict() -> new empty dictionary
2919 | dict(mapping) -> new dictionary initialized from a mapping object's
2917 | """dict() -> new empty dictionary
2918 | dict(mapping) -> new dictionary initialized from a mapping object's
|
info: Source
--> main.py:6:5

View File

@ -1 +1 @@
2480d7e7c74493a024eaf254c5d2c6f452c80ee2
47dbbd6c914a5190d54bc5bd498d1e6633d97db2

View File

@ -939,10 +939,8 @@ class AbstractEventLoop:
async def shutdown_default_executor(self) -> None:
"""Schedule the shutdown of the default executor."""
# This class does not exist at runtime, but stubtest complains if it's marked as
# @type_check_only because it has an alias that does exist at runtime. See mypy#19568.
# @type_check_only
class _AbstractEventLoopPolicy:
if sys.version_info >= (3, 14):
class _AbstractEventLoopPolicy:
"""Abstract policy for accessing the event loop."""
@abstractmethod
@ -966,8 +964,17 @@ class _AbstractEventLoopPolicy:
policy's rules. If there's need to set this loop as the event loop for
the current context, set_event_loop must be called explicitly.
"""
else:
@type_check_only
class _AbstractEventLoopPolicy:
@abstractmethod
def get_event_loop(self) -> AbstractEventLoop: ...
@abstractmethod
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
@abstractmethod
def new_event_loop(self) -> AbstractEventLoop: ...
# Child processes handling (Unix only).
if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@abstractmethod
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
@ -981,7 +988,6 @@ class _AbstractEventLoopPolicy:
@abstractmethod
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
if sys.version_info < (3, 14):
AbstractEventLoopPolicy = _AbstractEventLoopPolicy
if sys.version_info >= (3, 14):

View File

@ -2687,8 +2687,7 @@ class slice(Generic[_StartT_co, _StopT_co, _StepT_co]):
handling of normal slices.
"""
# Making this a disjoint_base upsets pyright
# @disjoint_base
@disjoint_base
class tuple(Sequence[_T_co]):
"""Built-in immutable sequence.
@ -3355,10 +3354,8 @@ class property:
def __delete__(self, instance: Any, /) -> None:
"""Delete an attribute of instance."""
# This class does not exist at runtime, but stubtest complains if it's marked as
# @type_check_only because it has an alias that does exist at runtime. See mypy#19568.
# @type_check_only
@final
@type_check_only
class _NotImplementedType(Any):
__call__: None

View File

@ -1930,7 +1930,8 @@ class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods
>>> turtle.end_fill()
"""
def dot(self, size: int | None = None, *color: _Color) -> None:
@overload
def dot(self, size: int | _Color | None = None) -> None:
"""Draw a dot with diameter size, using color.
Optional arguments:
@ -1945,6 +1946,10 @@ class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods
>>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
"""
@overload
def dot(self, size: int | None, color: _Color, /) -> None: ...
@overload
def dot(self, size: int | None, r: float, g: float, b: float, /) -> None: ...
def write(
self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")
) -> None:
@ -3827,7 +3832,8 @@ def end_fill() -> None:
>>> end_fill()
"""
def dot(size: int | None = None, *color: _Color) -> None:
@overload
def dot(size: int | _Color | None = None) -> None:
"""Draw a dot with diameter size, using color.
Optional arguments:
@ -3842,6 +3848,10 @@ def dot(size: int | None = None, *color: _Color) -> None:
>>> fd(50); dot(20, "blue"); fd(50)
"""
@overload
def dot(size: int | None, color: _Color, /) -> None: ...
@overload
def dot(size: int | None, r: float, g: float, b: float, /) -> None: ...
def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None:
"""Write text at the current turtle position.

View File

@ -853,7 +853,8 @@ class MagicProxy(Base):
def create_mock(self) -> Any: ...
def __get__(self, obj: Any, _type: Any | None = None) -> Any: ...
class _ANY:
# See https://github.com/python/typeshed/issues/14701
class _ANY(Any):
"""A helper object that compares equal to everything."""
def __eq__(self, other: object) -> Literal[True]: ...