Use SupportsIndex where applicable in builtins.pyi (#5739)

* Use `SupportsIndex` where applicable in `builtins.pyi`

* Remove `None` from the `int.__round__` ndigits parameter
This commit is contained in:
Bas van Beek
2021-07-09 12:08:19 +02:00
committed by GitHub
parent 0330530de0
commit 5e23e2c19a
2 changed files with 22 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
import textwrap
from typing import IO, Any, Callable, Dict, Generic, List, Optional, Text, Tuple, Type, TypeVar, Union, overload
from typing_extensions import SupportsIndex
_TB = TypeVar("_TB", bound="_BaseEntry")
_TP = TypeVar("_TP", bound="POFile")
@@ -35,7 +36,7 @@ class _BaseFile(List[_TB]):
def __contains__(self, entry: _TB) -> bool: ... # type: ignore # AttributeError otherwise
def __eq__(self, other: object) -> bool: ...
def append(self, entry: _TB) -> None: ...
def insert(self, index: int, entry: _TB) -> None: ...
def insert(self, index: SupportsIndex, entry: _TB) -> None: ...
def metadata_as_entry(self) -> POEntry: ...
def save(self, fpath: Optional[Text] = ..., repr_method: str = ...) -> None: ...
def find(self, st: Text, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: bool = ...) -> Optional[_TB]: ...