mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 21:50:21 +08:00
Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user