Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Generator, Iterable, List, Text
from typing import Any, Generator, Iterable, Text
class HTMLParser(object): # actually html5lib.HTMLParser
def __getattr__(self, __name: Text) -> Any: ... # incomplete
@@ -13,7 +13,7 @@ class HTMLSerializer(object): # actually html5lib.serializer.HTMLSerializer
def __getattr__(self, __name: Text) -> Any: ... # incomplete
class BleachHTMLParser(HTMLParser):
tags: List[Text] | None
tags: list[Text] | None
strip: bool
consume_entities: bool
def __init__(self, tags: Iterable[Text] | None, strip: bool, consume_entities: bool, **kwargs) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Container, Iterable, List, MutableMapping, Pattern, Protocol, Text
from typing import Any, Container, Iterable, MutableMapping, Pattern, Protocol, Text
from .html5lib_shim import Filter
@@ -7,9 +7,9 @@ _Attrs = MutableMapping[Any, Text]
class _Callback(Protocol):
def __call__(self, attrs: _Attrs, new: bool = ...) -> _Attrs: ...
DEFAULT_CALLBACKS: List[_Callback]
DEFAULT_CALLBACKS: list[_Callback]
TLDS: List[Text]
TLDS: list[Text]
def build_url_re(tlds: Iterable[Text] = ..., protocols: Iterable[Text] = ...) -> Pattern[Text]: ...

View File

@@ -2,10 +2,10 @@ from typing import Any, Callable, Container, Dict, Iterable, List, Pattern, Text
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter
ALLOWED_TAGS: List[Text]
ALLOWED_ATTRIBUTES: Dict[Text, List[Text]]
ALLOWED_STYLES: List[Text]
ALLOWED_PROTOCOLS: List[Text]
ALLOWED_TAGS: list[Text]
ALLOWED_ATTRIBUTES: dict[Text, list[Text]]
ALLOWED_STYLES: list[Text]
ALLOWED_PROTOCOLS: list[Text]
INVISIBLE_CHARACTERS: Text
INVISIBLE_CHARACTERS_RE: Pattern[Text]