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

This commit is contained in:
Brian Schubert
2025-08-08 05:29:48 -04:00
committed by GitHub
parent a358dc24e8
commit 81c8fcb2e6
131 changed files with 334 additions and 147 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
from _typeshed import Unused
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from typing import Any, Final, Literal, NoReturn, overload
from typing import Any, Final, Literal, NoReturn, overload, type_check_only
from typing_extensions import Self
import numpy
@@ -11,6 +11,7 @@ from numpy.typing import NDArray
# Actual type: _cffi_backend.__CDataOwn <cdata 'struct _jack_position *'>
# This is not a real subclassing. Just ensuring type-checkers sees this type as compatible with _CDataBase
# pyright has no error code for subclassing final
@type_check_only
class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]
audio_frames_per_video_frame: float
bar: int
@@ -33,6 +34,7 @@ class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore[repor
valid: int
video_offset: int
@type_check_only
class _CBufferType:
@overload
def __getitem__(self, key: int) -> str: ...