Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document empty tuple syntax #4313

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 3 commits into from
Dec 4, 2017
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
2 changes: 2 additions & 0 deletions docs/source/builtin_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Type Description
``bytes`` 8-bit string
``object`` an arbitrary object (``object`` is the common base class)
``List[str]`` list of ``str`` objects
``Tuple[int, int]`` tuple of two ``int``s (``Tuple[()]`` is the empty tuple)
``Tuple[int, ...]`` tuple of an arbitrary number of ``int`` objects
``Dict[str, int]`` dictionary from ``str`` keys to ``int`` values
``Iterable[int]`` iterable object containing ints
``Sequence[bool]`` sequence of booleans
Expand Down
3 changes: 3 additions & 0 deletions docs/source/cheat_sheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ Built-in types
x = [1] # type: List[int]
x = set([6, 7]) # type: Set[int]

# Empty Tuple types are a bit special
x = () # type: Tuple[()]

# For mappings, we need the types of both keys and values.
x = dict(field=2.0) # type: Dict[str, float]

Expand Down
3 changes: 3 additions & 0 deletions docs/source/cheat_sheet_py3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Built-in types
x = [1] # type: List[int]
x = {6, 7} # type: Set[int]

# Empty Tuple types are a bit special
x = () # type: Tuple[()]

# For mappings, we need the types of both keys and values.
x = {'field': 2.0} # type: Dict[str, float]

Expand Down