From e81ebeeffdce310812691b894836042ee4970d68 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Fri, 9 May 2025 13:33:38 +0400 Subject: [PATCH] Complete `bleach` --- pyrightconfig.stricter.json | 1 - stubs/bleach/bleach/linkifier.pyi | 3 +-- stubs/bleach/bleach/sanitizer.pyi | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 74196972b4ee..a38c73ba6dd1 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -28,7 +28,6 @@ "stubs/Authlib", "stubs/aws-xray-sdk", "stubs/beautifulsoup4", - "stubs/bleach/bleach/sanitizer.pyi", "stubs/boltons", "stubs/braintree", "stubs/caldav", diff --git a/stubs/bleach/bleach/linkifier.pyi b/stubs/bleach/bleach/linkifier.pyi index efb0c83dbdc0..73fe653c1b62 100644 --- a/stubs/bleach/bleach/linkifier.pyi +++ b/stubs/bleach/bleach/linkifier.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from collections.abc import Container, Iterable, Iterator, Sequence from re import Pattern from typing import Any, Final @@ -59,4 +58,4 @@ class LinkifyFilter(Filter): def handle_links(self, src_iter: Iterable[_Token]) -> Iterator[_Token]: ... def handle_a_tag(self, token_buffer: Sequence[_Token]) -> Iterator[_Token]: ... def extract_entities(self, token: _Token) -> Iterator[_Token]: ... - def __iter__(self) -> Iterator[Incomplete]: ... + def __iter__(self) -> Iterator[_Token]: ... diff --git a/stubs/bleach/bleach/sanitizer.pyi b/stubs/bleach/bleach/sanitizer.pyi index 6771387e71ad..f13e8637867b 100644 --- a/stubs/bleach/bleach/sanitizer.pyi +++ b/stubs/bleach/bleach/sanitizer.pyi @@ -24,7 +24,7 @@ class NoCssSanitizerWarning(UserWarning): ... # A html5lib Filter class class _Filter(Protocol): - def __call__(self, *, source: BleachSanitizerFilter): ... + def __call__(self, *, source: BleachSanitizerFilter) -> BleachSanitizerFilter: ... _AttributeFilter: TypeAlias = Callable[[str, str, str], bool] _AttributeDict: TypeAlias = dict[str, list[str] | _AttributeFilter] | dict[str, list[str]] | dict[str, _AttributeFilter]