mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -137,7 +137,7 @@ class TypeVar:
|
||||
__covariant__: bool
|
||||
__contravariant__: bool
|
||||
def __init__(
|
||||
self, name: str, *constraints: Any, bound: Any | None = ..., covariant: bool = ..., contravariant: bool = ...
|
||||
self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
@@ -215,7 +215,9 @@ if sys.version_info >= (3, 10):
|
||||
__bound__: Any | None
|
||||
__covariant__: bool
|
||||
__contravariant__: bool
|
||||
def __init__(self, name: str, *, bound: Any | None = ..., contravariant: bool = ..., covariant: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False
|
||||
) -> None: ...
|
||||
@property
|
||||
def args(self) -> ParamSpecArgs: ...
|
||||
@property
|
||||
@@ -465,7 +467,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
|
||||
@abstractmethod
|
||||
def __getitem__(self, index: slice) -> Sequence[_T_co]: ...
|
||||
# Mixin methods
|
||||
def index(self, value: Any, start: int = ..., stop: int = ...) -> int: ...
|
||||
def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ...
|
||||
def count(self, value: Any) -> int: ...
|
||||
def __contains__(self, value: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
@@ -497,7 +499,7 @@ class MutableSequence(Sequence[_T], Generic[_T]):
|
||||
def clear(self) -> None: ...
|
||||
def extend(self, values: Iterable[_T]) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def pop(self, index: int = ...) -> _T: ...
|
||||
def pop(self, index: int = -1) -> _T: ...
|
||||
def remove(self, value: _T) -> None: ...
|
||||
def __iadd__(self: _typeshed.Self, values: Iterable[_T]) -> _typeshed.Self: ...
|
||||
|
||||
@@ -728,9 +730,9 @@ _get_type_hints_obj_allowed_types = ( # noqa: Y026 # TODO: Use TypeAlias once
|
||||
if sys.version_info >= (3, 9):
|
||||
def get_type_hints(
|
||||
obj: _get_type_hints_obj_allowed_types,
|
||||
globalns: dict[str, Any] | None = ...,
|
||||
localns: dict[str, Any] | None = ...,
|
||||
include_extras: bool = ...,
|
||||
globalns: dict[str, Any] | None = None,
|
||||
localns: dict[str, Any] | None = None,
|
||||
include_extras: bool = False,
|
||||
) -> dict[str, Any]: ...
|
||||
|
||||
else:
|
||||
@@ -757,9 +759,9 @@ if sys.version_info >= (3, 11):
|
||||
def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ...
|
||||
def dataclass_transform(
|
||||
*,
|
||||
eq_default: bool = ...,
|
||||
order_default: bool = ...,
|
||||
kw_only_default: bool = ...,
|
||||
eq_default: bool = True,
|
||||
order_default: bool = False,
|
||||
kw_only_default: bool = False,
|
||||
field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = ...,
|
||||
**kwargs: Any,
|
||||
) -> IdentityFunction: ...
|
||||
@@ -821,7 +823,7 @@ class ForwardRef:
|
||||
__forward_module__: Any | None
|
||||
if sys.version_info >= (3, 9):
|
||||
# The module and is_class arguments were added in later Python 3.9 versions.
|
||||
def __init__(self, arg: str, is_argument: bool = ..., module: Any | None = ..., *, is_class: bool = ...) -> None: ...
|
||||
def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ...
|
||||
else:
|
||||
def __init__(self, arg: str, is_argument: bool = ...) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user