mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add @type_check_only to stub-only private classes in stdlib (#14512)
This commit is contained in:
@@ -4,7 +4,7 @@ from _typeshed import Unused
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from logging import Logger
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import Any, Final, Generic, NamedTuple, Protocol, TypeVar
|
||||
from typing import Any, Final, Generic, NamedTuple, Protocol, TypeVar, type_check_only
|
||||
from typing_extensions import ParamSpec, Self
|
||||
|
||||
FIRST_COMPLETED: Final = "FIRST_COMPLETED"
|
||||
@@ -74,6 +74,7 @@ class Executor:
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
@type_check_only
|
||||
class _AsCompletedFuture(Protocol[_T_co]):
|
||||
# as_completed only mutates non-generic aspects of passed Futures and does not do any nominal
|
||||
# checks. Therefore, we can use a Protocol here to allow as_completed to act covariantly.
|
||||
|
||||
Reference in New Issue
Block a user