File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ Type Description
1313``bytes `` 8-bit string
1414``object `` an arbitrary object (``object `` is the common base class)
1515``List[str] `` list of ``str `` objects
16+ ``Tuple[int, int] `` tuple of two ``int``s (``Tuple[()] `` is the empty tuple)
17+ ``Tuple[int, ...] `` tuple of an arbitrary number of ``int `` objects
1618``Dict[str, int] `` dictionary from ``str `` keys to ``int `` values
1719``Iterable[int] `` iterable object containing ints
1820``Sequence[bool] `` sequence of booleans
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ Built-in types
3333 x = [1 ] # type: List [ int ]
3434 x = set ([6 , 7 ]) # type: Set [ int ]
3535
36+ # Empty Tuple types are a bit special
37+ x = () # type: Tuple [()]
38+
3639 # For mappings, we need the types of both keys and values.
3740 x = dict (field = 2.0 ) # type: Dict [ str , float ]
3841
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ Built-in types
3434 x = [1 ] # type: List [ int ]
3535 x = {6 , 7 } # type: Set [ int ]
3636
37+ # Empty Tuple types are a bit special
38+ x = () # type: Tuple [()]
39+
3740 # For mappings, we need the types of both keys and values.
3841 x = {' field' : 2.0 } # type: Dict [ str , float ]
3942
You can’t perform that action at this time.
0 commit comments