Update collections and typing.NamedTuple (#1276)

* Update stubs for `collections` module in both Pythons.
* Update `typing.NamedTuple` stub to have `_source` attribute.
* Fix compatibility of `deque.index` signature with supertype `Sequence`
This commit is contained in:
Semyon Proshev
2017-05-28 01:01:40 +03:00
committed by Jelle Zijlstra
parent 6f0c929658
commit f9872cafd8
4 changed files with 57 additions and 52 deletions

View File

@@ -495,6 +495,7 @@ def cast(tp: Type[_T], obj: Any) -> _T: ...
# NamedTuple is special-cased in the type checker
class NamedTuple(tuple):
_fields = ... # type: Tuple[str, ...]
_source = ... # type: str
def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., *,
verbose: bool = ..., rename: bool = ..., **kwargs: Any) -> None: ...