Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
from collections.abc import Callable, Container, Iterable
from typing import Any, Pattern, Union
from typing import Any, Pattern
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter
@@ -39,8 +39,8 @@ class Cleaner:
def clean(self, text: str) -> str: ...
_AttributeFilter = Callable[[str, str, str], bool]
_AttributeDict = Union[dict[str, Union[list[str], _AttributeFilter]], dict[str, list[str]], dict[str, _AttributeFilter]]
_Attributes = Union[_AttributeFilter, _AttributeDict, list[str]]
_AttributeDict = dict[str, list[str] | _AttributeFilter] | dict[str, list[str]] | dict[str, _AttributeFilter]
_Attributes = _AttributeFilter | _AttributeDict | list[str]
def attribute_filter_factory(attributes: _Attributes) -> _AttributeFilter: ...