mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-30 14:45:23 +08:00
Cleanup: use lower-case list and dict, add a test (#6161)
This commit is contained in:
@@ -235,7 +235,7 @@ class Tag(PageElement):
|
||||
sourcepos: int | None
|
||||
known_xml: bool | None
|
||||
attrs: Mapping[str, str]
|
||||
contents: List[PageElement]
|
||||
contents: list[PageElement]
|
||||
hidden: bool
|
||||
can_be_empty_element: bool | None
|
||||
cdata_list_attributes: list[str] | None
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Iterator, List
|
||||
from typing import Any, Iterator
|
||||
|
||||
from .locale import Locale
|
||||
|
||||
@@ -8,16 +8,16 @@ LOCALE_SPLIT_PATTERN: Any
|
||||
class LocaleDataLoader:
|
||||
def get_locale_map(
|
||||
self,
|
||||
languages: List[str] | None = ...,
|
||||
locales: List[str] | None = ...,
|
||||
languages: list[str] | None = ...,
|
||||
locales: list[str] | None = ...,
|
||||
region: str | None = ...,
|
||||
use_given_order: bool = ...,
|
||||
allow_conflicting_locales: bool = ...,
|
||||
) -> OrderedDict[str, List[Any] | str | int]: ...
|
||||
) -> OrderedDict[str, list[Any] | str | int]: ...
|
||||
def get_locales(
|
||||
self,
|
||||
languages: List[str] | None = ...,
|
||||
locales: List[str] | None = ...,
|
||||
languages: list[str] | None = ...,
|
||||
locales: list[str] | None = ...,
|
||||
region: str | None = ...,
|
||||
use_given_order: bool = ...,
|
||||
allow_conflicting_locales: bool = ...,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from typing import Any, List, Mapping, Set, Tuple, overload
|
||||
from typing import Any, Mapping, Set, Tuple, overload
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
@@ -10,14 +10,14 @@ else:
|
||||
@overload
|
||||
def search_dates(
|
||||
text: str,
|
||||
languages: List[str] | Tuple[str] | Set[str] | None,
|
||||
languages: list[str] | Tuple[str] | Set[str] | None,
|
||||
settings: Mapping[Any, Any] | None,
|
||||
add_detected_language: Literal[True],
|
||||
) -> List[Tuple[str, datetime, str]]: ...
|
||||
) -> list[Tuple[str, datetime, str]]: ...
|
||||
@overload
|
||||
def search_dates(
|
||||
text: str,
|
||||
languages: List[str] | Tuple[str] | Set[str] | None = ...,
|
||||
languages: list[str] | Tuple[str] | Set[str] | None = ...,
|
||||
settings: Mapping[Any, Any] | None = ...,
|
||||
add_detected_language: Literal[False] = ...,
|
||||
) -> List[Tuple[str, datetime]]: ...
|
||||
) -> list[Tuple[str, datetime]]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Dict, Iterator, List, Sequence, Text, Tuple, Type
|
||||
from typing import Any, Iterator, Sequence, Text, Tuple, Type
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
from configparser import ConfigParser
|
||||
@@ -53,5 +53,5 @@ def iter_files_distros(
|
||||
path: Sequence[Text] | None = ..., repeated_distro: Text = ...
|
||||
) -> Iterator[Tuple[ConfigParser, Distribution | None]]: ...
|
||||
def get_single(group: Text, name: Text, path: Sequence[Text] | None = ...) -> EntryPoint: ...
|
||||
def get_group_named(group: Text, path: Sequence[Text] | None = ...) -> Dict[str, EntryPoint]: ...
|
||||
def get_group_all(group: Text, path: Sequence[Text] | None = ...) -> List[EntryPoint]: ...
|
||||
def get_group_named(group: Text, path: Sequence[Text] | None = ...) -> dict[str, EntryPoint]: ...
|
||||
def get_group_all(group: Text, path: Sequence[Text] | None = ...) -> list[EntryPoint]: ...
|
||||
|
||||
Reference in New Issue
Block a user