mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from collections.abc import MutableMapping
|
||||
from typing import Protocol
|
||||
from typing import Protocol, type_check_only
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from bleach import _HTMLAttrKey
|
||||
|
||||
_HTMLAttrs: TypeAlias = MutableMapping[_HTMLAttrKey, str]
|
||||
|
||||
@type_check_only
|
||||
class _Callback(Protocol): # noqa: Y046
|
||||
def __call__(self, attrs: _HTMLAttrs, new: bool = ..., /) -> _HTMLAttrs: ...
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import re
|
||||
from codecs import CodecInfo
|
||||
from collections.abc import Generator, Iterable, Iterator
|
||||
from typing import Any, Final, Protocol
|
||||
from typing import Any, Final, Protocol, type_check_only
|
||||
|
||||
# We don't re-export any `html5lib` types / values here, because they are not
|
||||
# really public and may change at any time. This is just a helper module,
|
||||
@@ -14,6 +14,7 @@ from html5lib.serializer import HTMLSerializer
|
||||
from html5lib.treewalkers.base import TreeWalker
|
||||
|
||||
# Is actually webencodings.Encoding
|
||||
@type_check_only
|
||||
class _Encoding(Protocol):
|
||||
name: str
|
||||
codec_info: CodecInfo
|
||||
|
||||
Reference in New Issue
Block a user