mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-25 11:07:17 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Container, Iterable, Optional, Text
|
||||
from typing import Any, Container, Iterable, Text
|
||||
|
||||
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback
|
||||
from bleach.sanitizer import (
|
||||
@@ -26,5 +26,5 @@ def clean(
|
||||
strip_comments: bool = ...,
|
||||
) -> Text: ...
|
||||
def linkify(
|
||||
text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Optional[Container[Text]] = ..., parse_email: bool = ...
|
||||
text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Container[Text] | None = ..., parse_email: bool = ...
|
||||
) -> Text: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Generator, Iterable, List, Optional, Text
|
||||
from typing import Any, Generator, Iterable, List, Text
|
||||
|
||||
class HTMLParser(object): # actually html5lib.HTMLParser
|
||||
def __getattr__(self, __name: Text) -> Any: ... # incomplete
|
||||
@@ -13,14 +13,14 @@ class HTMLSerializer(object): # actually html5lib.serializer.HTMLSerializer
|
||||
def __getattr__(self, __name: Text) -> Any: ... # incomplete
|
||||
|
||||
class BleachHTMLParser(HTMLParser):
|
||||
tags: Optional[List[Text]]
|
||||
tags: List[Text] | None
|
||||
strip: bool
|
||||
consume_entities: bool
|
||||
def __init__(self, tags: Optional[Iterable[Text]], strip: bool, consume_entities: bool, **kwargs) -> None: ...
|
||||
def __init__(self, tags: Iterable[Text] | None, strip: bool, consume_entities: bool, **kwargs) -> None: ...
|
||||
|
||||
class BleachHTMLSerializer(HTMLSerializer):
|
||||
escape_rcdata: bool
|
||||
def escape_base_amp(self, stoken: Text) -> Generator[Text, None, None]: ...
|
||||
def serialize(self, treewalker, encoding: Optional[Text] = ...) -> Generator[Text, None, None]: ...
|
||||
def serialize(self, treewalker, encoding: Text | None = ...) -> Generator[Text, None, None]: ...
|
||||
|
||||
def __getattr__(__name: Text) -> Any: ... # incomplete
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Container, Iterable, List, MutableMapping, Optional, Pattern, Protocol, Text
|
||||
from typing import Any, Container, Iterable, List, MutableMapping, Pattern, Protocol, Text
|
||||
|
||||
from .html5lib_shim import Filter
|
||||
|
||||
@@ -24,11 +24,11 @@ class Linker(object):
|
||||
def __init__(
|
||||
self,
|
||||
callbacks: Iterable[_Callback] = ...,
|
||||
skip_tags: Optional[Container[Text]] = ...,
|
||||
skip_tags: Container[Text] | None = ...,
|
||||
parse_email: bool = ...,
|
||||
url_re: Pattern[Text] = ...,
|
||||
email_re: Pattern[Text] = ...,
|
||||
recognized_tags: Optional[Container[Text]] = ...,
|
||||
recognized_tags: Container[Text] | None = ...,
|
||||
) -> None: ...
|
||||
def linkify(self, text: Text) -> Text: ...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Union
|
||||
from typing import Any, Callable, Container, Dict, Iterable, List, Pattern, Text, Union
|
||||
|
||||
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter
|
||||
|
||||
@@ -33,7 +33,7 @@ class Cleaner(object):
|
||||
protocols: Container[Text] = ...,
|
||||
strip: bool = ...,
|
||||
strip_comments: bool = ...,
|
||||
filters: Optional[Iterable[_Filter]] = ...,
|
||||
filters: Iterable[_Filter] | None = ...,
|
||||
) -> None: ...
|
||||
def clean(self, text: Text) -> Text: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user