lowercase list and dict in the rest of stdlib (#5892)

This commit is contained in:
Akuli
2021-08-09 01:13:08 +03:00
committed by GitHub
parent 191aac3b0e
commit 9af9cca7f3
5 changed files with 53 additions and 49 deletions

View File

@@ -1,7 +1,7 @@
from _typeshed import SupportsWrite
from reprlib import Repr
from types import MethodType, ModuleType, TracebackType
from typing import IO, Any, AnyStr, Callable, Container, Dict, List, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type
from typing import IO, Any, AnyStr, Callable, Container, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type
# the return type of sys.exc_info(), used by ErrorDuringImport.__init__
_Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
@@ -11,7 +11,7 @@ __date__: str
__version__: str
__credits__: str
def pathdirs() -> List[str]: ...
def pathdirs() -> list[str]: ...
def getdoc(object: object) -> str: ...
def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def classname(object: object, modname: str) -> str: ...
@@ -21,7 +21,7 @@ def cram(text: str, maxlen: int) -> str: ...
def stripid(text: str) -> str: ...
def allmethods(cl: type) -> MutableMapping[str, MethodType]: ...
def visiblename(name: str, all: Container[str] | None = ..., obj: object | None = ...) -> bool: ...
def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ...
def classify_class_attrs(object: object) -> list[Tuple[str, str, type, str]]: ...
def ispackage(path: str) -> bool: ...
def source_synopsis(file: IO[AnyStr]) -> AnyStr | None: ...
def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> str | None: ...
@@ -81,7 +81,7 @@ class HTMLDoc(Doc):
) -> str: ...
def bigsection(self, title: str, *args: Any) -> str: ...
def preformat(self, text: str) -> str: ...
def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ...
def multicolumn(self, list: list[Any], format: Callable[[Any], str], cols: int = ...) -> str: ...
def grey(self, text: str) -> str: ...
def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ...
def classlink(self, object: object, modname: str) -> str: ...
@@ -96,7 +96,7 @@ class HTMLDoc(Doc):
methods: Mapping[str, str] = ...,
) -> str: ...
def formattree(
self, tree: List[Tuple[type, Tuple[type, ...]] | List[Any]], modname: str, parent: type | None = ...
self, tree: list[Tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ...
) -> str: ...
def docmodule(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
def docclass(
@@ -148,7 +148,7 @@ class TextDoc(Doc):
def indent(self, text: str, prefix: str = ...) -> str: ...
def section(self, title: str, contents: str) -> str: ...
def formattree(
self, tree: List[Tuple[type, Tuple[type, ...]] | List[Any]], modname: str, parent: type | None = ..., prefix: str = ...
self, tree: list[Tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ...
) -> str: ...
def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ..., *ignored: Any) -> str: ...
def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
@@ -194,10 +194,12 @@ def doc(thing: str | object, title: str = ..., forceload: bool = ..., output: Su
def writedoc(thing: str | object, forceload: bool = ...) -> None: ...
def writedocs(dir: str, pkgpath: str = ..., done: Any | None = ...) -> None: ...
_list = list # "list" conflicts with method name
class Helper:
keywords: Dict[str, str | Tuple[str, str]]
symbols: Dict[str, str]
topics: Dict[str, str | Tuple[str, ...]]
keywords: dict[str, str | Tuple[str, str]]
symbols: dict[str, str]
topics: dict[str, str | Tuple[str, ...]]
def __init__(self, input: IO[str] | None = ..., output: IO[str] | None = ...) -> None: ...
input: IO[str]
output: IO[str]
@@ -206,7 +208,7 @@ class Helper:
def getline(self, prompt: str) -> str: ...
def help(self, request: Any) -> None: ...
def intro(self) -> None: ...
def list(self, items: List[str], columns: int = ..., width: int = ...) -> None: ...
def list(self, items: _list[str], columns: int = ..., width: int = ...) -> None: ...
def listkeywords(self) -> None: ...
def listsymbols(self) -> None: ...
def listtopics(self) -> None: ...