mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
minor namedtuple fixes (#2227)
- The extra arguments aren't keyword-only in 2.7. - Added the `defaults` argument in 3.7 (https://docs.python.org/3.7/library/collections.html#collections.namedtuple).
This commit is contained in:
committed by
Ivan Levkivskyi
parent
c3b5513475
commit
9e023e7586
@@ -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.
|
||||
@@ -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]):
|
||||
|
||||
Reference in New Issue
Block a user