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:
Semyon Proshev
2017-05-04 18:26:15 +03:00
committed by Jelle Zijlstra
parent e080d8ea77
commit a2561cc4b2
2 changed files with 4 additions and 4 deletions

View File

@@ -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: ...