Skip to content

minor namedtuple fixes #2227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions stdlib/2/collections.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Stubs for collections

# Based on http://docs.python.org/2.7/library/collections.html

# These are not exported.
import typing
from typing import Dict, Generic, TypeVar, Tuple, overload, Type, Optional, List, Union, Reversible

# These are exported.
Expand Down Expand Up @@ -31,7 +26,7 @@ _KT = TypeVar('_KT')
_VT = TypeVar('_VT')

# namedtuple is special-cased in the type checker; the initializer is ignored.
def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], *,
def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]],
verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ...

class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
Expand Down
6 changes: 1 addition & 5 deletions stdlib/3/collections/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Stubs for collections

# Based on http://docs.python.org/3.2/library/collections.html

# These are not exported.
import sys
import typing
Expand Down Expand Up @@ -54,7 +50,7 @@ _VT = TypeVar('_VT')
# namedtuple is special-cased in the type checker; the initializer is ignored.
if sys.version_info >= (3, 7):
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
rename: bool = ..., module: Optional[str] = ..., defaults: Optional[Iterable[Any]] = ...) -> Type[tuple]: ...
elif sys.version_info >= (3, 6):
def namedtuple(typename: str, field_names: Union[str, Iterable[str]], *,
verbose: bool = ..., rename: bool = ..., module: Optional[str] = ...) -> Type[tuple]: ...
Expand Down