Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor whitespace/punctuation changes
  • Loading branch information
vilmibm committed May 22, 2017
commit 94aa1baf1669139fa2d2564ecf13d91d739f07eb
6 changes: 2 additions & 4 deletions docs/source/common_issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,18 @@ Types of empty collections
--------------------------

You often need to specify the type when you assign an empty list or
dict to a new variable.
dict to a new variable:

.. code-block:: python

a = [] # error: Need type annotation for variable


Without the annotation mypy can't always figure out the precise type of ``a``.
Without an annotation mypy can't always figure out the precise type of ``a``.

.. code-block:: python

a: List[int] = []


You can use a simple empty list literal in a dynamically typed function (as the
type of ``a`` would be implicitly ``Any`` and need not be inferred), if type
of the variable has been declared or inferred before, or if you perform a simple
Expand Down