mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 17:43:25 +08:00
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:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user