mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-19 23:09:55 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from _typeshed import Self, SupportsRead
|
||||
from typing import Any, Sequence, Type
|
||||
from typing import Any, Sequence
|
||||
|
||||
from .builder import TreeBuilder
|
||||
from .element import PageElement, SoupStrainer, Tag
|
||||
@@ -23,11 +23,11 @@ class BeautifulSoup(Tag):
|
||||
self,
|
||||
markup: str | bytes | SupportsRead[str] | SupportsRead[bytes] = ...,
|
||||
features: str | Sequence[str] | None = ...,
|
||||
builder: TreeBuilder | Type[TreeBuilder] | None = ...,
|
||||
builder: TreeBuilder | type[TreeBuilder] | None = ...,
|
||||
parse_only: SoupStrainer | None = ...,
|
||||
from_encoding: str | None = ...,
|
||||
exclude_encodings: Sequence[str] | None = ...,
|
||||
element_classes: dict[Type[PageElement], Type[Any]] | None = ...,
|
||||
element_classes: dict[type[PageElement], type[Any]] | None = ...,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Pattern, Type, TypeVar, Union, overload
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Pattern, TypeVar, Union, overload
|
||||
|
||||
from . import BeautifulSoup
|
||||
from .builder import TreeBuilder
|
||||
@@ -13,7 +13,7 @@ whitespace_re: Pattern[str]
|
||||
PYTHON_SPECIFIC_ENCODINGS: set[str]
|
||||
|
||||
class NamespacedAttribute(str):
|
||||
def __new__(cls: Type[Self], prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ...
|
||||
def __new__(cls: type[Self], prefix: str, name: str | None = ..., namespace: str | None = ...) -> Self: ...
|
||||
|
||||
class AttributeValueWithCharsetSubstitution(str): ...
|
||||
|
||||
@@ -53,7 +53,7 @@ class PageElement:
|
||||
previousSibling: PageElement | None
|
||||
@property
|
||||
def stripped_strings(self) -> Iterator[str]: ...
|
||||
def get_text(self, separator: str = ..., strip: bool = ..., types: tuple[Type[NavigableString], ...] = ...) -> str: ...
|
||||
def get_text(self, separator: str = ..., strip: bool = ..., types: tuple[type[NavigableString], ...] = ...) -> str: ...
|
||||
getText = get_text
|
||||
@property
|
||||
def text(self) -> str: ...
|
||||
@@ -182,7 +182,7 @@ class NavigableString(str, PageElement):
|
||||
PREFIX: str
|
||||
SUFFIX: str
|
||||
known_xml: bool | None
|
||||
def __new__(cls: Type[Self], value: str | bytes) -> Self: ...
|
||||
def __new__(cls: type[Self], value: str | bytes) -> Self: ...
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
def __getnewargs__(self) -> tuple[str]: ...
|
||||
def output_ready(self, formatter: Formatter | str | None = ...) -> str: ...
|
||||
@@ -227,7 +227,7 @@ class Script(NavigableString): ...
|
||||
class TemplateString(NavigableString): ...
|
||||
|
||||
class Tag(PageElement):
|
||||
parser_class: Type[BeautifulSoup] | None
|
||||
parser_class: type[BeautifulSoup] | None
|
||||
name: str
|
||||
namespace: str | None
|
||||
prefix: str | None
|
||||
@@ -256,9 +256,9 @@ class Tag(PageElement):
|
||||
can_be_empty_element: bool | None = ...,
|
||||
cdata_list_attributes: list[str] | None = ...,
|
||||
preserve_whitespace_tags: list[str] | None = ...,
|
||||
interesting_string_types: Type[NavigableString] | tuple[Type[NavigableString], ...] | None = ...,
|
||||
interesting_string_types: type[NavigableString] | tuple[type[NavigableString], ...] | None = ...,
|
||||
) -> None: ...
|
||||
parserClass: Type[BeautifulSoup] | None
|
||||
parserClass: type[BeautifulSoup] | None
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
@property
|
||||
def is_empty_element(self) -> bool: ...
|
||||
@@ -267,7 +267,7 @@ class Tag(PageElement):
|
||||
def string(self) -> str | None: ...
|
||||
@string.setter
|
||||
def string(self, string: str) -> None: ...
|
||||
DEFAULT_INTERESTING_STRING_TYPES: tuple[Type[NavigableString], ...]
|
||||
DEFAULT_INTERESTING_STRING_TYPES: tuple[type[NavigableString], ...]
|
||||
@property
|
||||
def strings(self) -> Iterable[str]: ...
|
||||
def decompose(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user