Skip to content

Commit 647ea8c

Browse files
github-actions[bot]cdce8phauntsaninjaAlexWaygood
authored
Sync typeshed (#19848)
Sync typeshed Source commit: python/typeshed@0d100b9 Note that you will need to close and re-open the PR in order to trigger CI. --------- Co-authored-by: mypybot <> Co-authored-by: Marc Mueller <[email protected]> Co-authored-by: Shantanu <[email protected]> Co-authored-by: AlexWaygood <[email protected]>
1 parent 8412d1d commit 647ea8c

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

mypy/typeshed/stdlib/asyncio/events.pyi

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -602,18 +602,25 @@ class AbstractEventLoop:
602602
@abstractmethod
603603
async def shutdown_default_executor(self) -> None: ...
604604

605-
# This class does not exist at runtime, but stubtest complains if it's marked as
606-
# @type_check_only because it has an alias that does exist at runtime. See mypy#19568.
607-
# @type_check_only
608-
class _AbstractEventLoopPolicy:
609-
@abstractmethod
610-
def get_event_loop(self) -> AbstractEventLoop: ...
611-
@abstractmethod
612-
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
613-
@abstractmethod
614-
def new_event_loop(self) -> AbstractEventLoop: ...
615-
# Child processes handling (Unix only).
616-
if sys.version_info < (3, 14):
605+
if sys.version_info >= (3, 14):
606+
class _AbstractEventLoopPolicy:
607+
@abstractmethod
608+
def get_event_loop(self) -> AbstractEventLoop: ...
609+
@abstractmethod
610+
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
611+
@abstractmethod
612+
def new_event_loop(self) -> AbstractEventLoop: ...
613+
614+
else:
615+
@type_check_only
616+
class _AbstractEventLoopPolicy:
617+
@abstractmethod
618+
def get_event_loop(self) -> AbstractEventLoop: ...
619+
@abstractmethod
620+
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
621+
@abstractmethod
622+
def new_event_loop(self) -> AbstractEventLoop: ...
623+
# Child processes handling (Unix only).
617624
if sys.version_info >= (3, 12):
618625
@abstractmethod
619626
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
@@ -627,7 +634,6 @@ class _AbstractEventLoopPolicy:
627634
@abstractmethod
628635
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
629636

630-
if sys.version_info < (3, 14):
631637
AbstractEventLoopPolicy = _AbstractEventLoopPolicy
632638

633639
if sys.version_info >= (3, 14):

mypy/typeshed/stdlib/builtins.pyi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,7 @@ class slice(Generic[_StartT_co, _StopT_co, _StepT_co]):
923923

924924
def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ...
925925

926-
# Making this a disjoint_base upsets pyright
927-
# @disjoint_base
926+
@disjoint_base
928927
class tuple(Sequence[_T_co]):
929928
def __new__(cls, iterable: Iterable[_T_co] = ..., /) -> Self: ...
930929
def __len__(self) -> int: ...
@@ -1266,10 +1265,8 @@ class property:
12661265
def __set__(self, instance: Any, value: Any, /) -> None: ...
12671266
def __delete__(self, instance: Any, /) -> None: ...
12681267

1269-
# This class does not exist at runtime, but stubtest complains if it's marked as
1270-
# @type_check_only because it has an alias that does exist at runtime. See mypy#19568.
1271-
# @type_check_only
12721268
@final
1269+
@type_check_only
12731270
class _NotImplementedType(Any):
12741271
__call__: None
12751272

mypy/typeshed/stdlib/turtle.pyi

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,12 @@ class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods
463463

464464
def begin_fill(self) -> None: ...
465465
def end_fill(self) -> None: ...
466-
def dot(self, size: int | None = None, *color: _Color) -> None: ...
466+
@overload
467+
def dot(self, size: int | _Color | None = None) -> None: ...
468+
@overload
469+
def dot(self, size: int | None, color: _Color, /) -> None: ...
470+
@overload
471+
def dot(self, size: int | None, r: float, g: float, b: float, /) -> None: ...
467472
def write(
468473
self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")
469474
) -> None: ...
@@ -747,7 +752,12 @@ if sys.version_info >= (3, 14):
747752

748753
def begin_fill() -> None: ...
749754
def end_fill() -> None: ...
750-
def dot(size: int | None = None, *color: _Color) -> None: ...
755+
@overload
756+
def dot(size: int | _Color | None = None) -> None: ...
757+
@overload
758+
def dot(size: int | None, color: _Color, /) -> None: ...
759+
@overload
760+
def dot(size: int | None, r: float, g: float, b: float, /) -> None: ...
751761
def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None: ...
752762

753763
if sys.version_info >= (3, 14):

mypy/typeshed/stdlib/unittest/mock.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ class MagicProxy(Base):
508508
def create_mock(self) -> Any: ...
509509
def __get__(self, obj: Any, _type: Any | None = None) -> Any: ...
510510

511-
class _ANY:
511+
# See https://github.com/python/typeshed/issues/14701
512+
class _ANY(Any):
512513
def __eq__(self, other: object) -> Literal[True]: ...
513514
def __ne__(self, other: object) -> Literal[False]: ...
514515
__hash__: ClassVar[None] # type: ignore[assignment]

0 commit comments

Comments
 (0)