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
+3 -1
View File
@@ -1,6 +1,6 @@
from collections.abc import Iterator, MutableSet
from re import Pattern
from typing import Any, TypedDict
from typing import Any, TypedDict, type_check_only
from typing_extensions import deprecated
from xml.etree.ElementTree import Element
@@ -10,11 +10,13 @@ from markdown.treeprocessors import Treeprocessor
IDCOUNT_RE: Pattern[str]
@type_check_only
class _FlatTocToken(TypedDict):
level: int
id: str
name: str
@type_check_only
class _TocToken(_FlatTocToken):
children: list[_TocToken]
+2 -1
View File
@@ -1,7 +1,7 @@
import sys
from collections.abc import Iterator
from re import Pattern
from typing import Final, Generic, TypedDict, TypeVar, overload
from typing import Final, Generic, TypedDict, TypeVar, overload, type_check_only
from markdown.core import Markdown
@@ -40,6 +40,7 @@ class Processor:
md: Markdown
def __init__(self, md: Markdown | None = None) -> None: ...
@type_check_only
class _TagData(TypedDict):
tag: str
attrs: dict[str, str]