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
@@ -2,7 +2,7 @@ import sys
from collections.abc import Callable
from contextvars import Context
from types import FrameType, TracebackType
from typing import Any, Literal, Protocol, overload
from typing import Any, Literal, Protocol, overload, type_check_only
from typing_extensions import TypeAlias
_TraceEvent: TypeAlias = Literal["switch", "throw"]
@@ -19,6 +19,7 @@ GREENLET_USE_TRACING: bool
# to pass this around, can still pass it around without having to ignore type errors...
_C_API: object
@type_check_only
class _ParentDescriptor(Protocol):
def __get__(self, obj: greenlet, owner: type[greenlet] | None = None) -> greenlet | None: ...
def __set__(self, obj: greenlet, value: greenlet) -> None: ...