Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)

This commit is contained in:
Brian Schubert
2025-08-08 11:29:48 +02:00
committed by GitHub
parent a358dc24e8
commit 81c8fcb2e6
131 changed files with 334 additions and 147 deletions
+2 -1
View File
@@ -1,11 +1,12 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing import ClassVar
from typing import ClassVar, type_check_only
from typing_extensions import Self
__all__ = ["TqdmCallback"]
# dask.callbacks.Callback
@type_check_only
class _Callback:
active: ClassVar[set[tuple[Callable[..., Incomplete] | None, ...]]]
def __init__(
+2 -1
View File
@@ -1,7 +1,7 @@
from _typeshed import Incomplete, SupportsWrite
from abc import ABC, abstractmethod
from collections.abc import Iterable, Mapping
from typing import NoReturn, TypeVar, overload
from typing import NoReturn, TypeVar, overload, type_check_only
from .std import tqdm as std_tqdm
@@ -10,6 +10,7 @@ __all__ = ["tqdm_rich", "trrange", "tqdm", "trange"]
_T = TypeVar("_T")
# Actually rich.progress.ProgressColumn
@type_check_only
class _ProgressColumn(ABC):
max_refresh: float | None
def __init__(self, table_column: Incomplete | None = ...) -> None: ...
+2 -1
View File
@@ -1,7 +1,7 @@
from _typeshed import Incomplete
from collections.abc import Callable, Mapping
from re import Pattern
from typing import Protocol, TypeVar
from typing import Protocol, TypeVar, type_check_only
from typing_extensions import ParamSpec
CUR_OS: str
@@ -15,6 +15,7 @@ class FormatReplace:
def __init__(self, replace: str = "") -> None: ...
def __format__(self, _) -> str: ...
@type_check_only
class _Has__Comparable(Protocol):
_comparable: Incomplete