mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Update typing.NamedTuple.__init__ to support fields passed through kwargs (#1239)
* Update `typing.NamedTuple.__init__` to support fields passed through kwargs * `Verbose` and `rename` were returned to `typing.NamedTuple.__init__`
This commit is contained in:
committed by
Jelle Zijlstra
parent
e080d8ea77
commit
a2561cc4b2
@@ -389,8 +389,8 @@ def cast(tp: Type[_T], obj: Any) -> _T: ...
|
||||
class NamedTuple(tuple):
|
||||
_fields = ... # type: Tuple[str, ...]
|
||||
|
||||
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]], *,
|
||||
verbose: bool = ..., rename: bool = ...) -> None: ...
|
||||
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., *,
|
||||
verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def _make(cls, iterable: Iterable[Any]) -> NamedTuple: ...
|
||||
|
||||
@@ -492,8 +492,8 @@ def cast(tp: Type[_T], obj: Any) -> _T: ...
|
||||
class NamedTuple(tuple):
|
||||
_fields = ... # type: Tuple[str, ...]
|
||||
|
||||
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]], *,
|
||||
verbose: bool = ..., rename: bool = ..., module: Any = ...) -> None: ...
|
||||
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., *,
|
||||
verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def _make(cls, iterable: Iterable[Any]) -> NamedTuple: ...
|
||||
|
||||
Reference in New Issue
Block a user