From 924f693000a51e860bead6238a298a40b41e6cca Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 18 May 2015 13:16:48 -0700 Subject: [PATCH] Document "x = ... # type: " for use in stubs. Closes #81. --- pep-0484.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pep-0484.txt b/pep-0484.txt index c02745076..c10499e5e 100644 --- a/pep-0484.txt +++ b/pep-0484.txt @@ -678,6 +678,14 @@ Examples of type comments on ``with`` and ``for`` statements:: # Here x and y are floats ... +In stubs it may be useful to declare the existence of a variable +without giving it an initial value. This can be done using a literal +ellipsis:: + + from typing import IO + + stream = ... # type: IO[str] + The ``# type: ignore`` comment should be put on the line that the error refers to::