8000 Clarify forward references. Fixes #2259 · python/mypy@99904e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99904e0

Browse files
author
Guido van Rossum
committed
Clarify forward references. Fixes #2259
1 parent f061844 commit 99904e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/source/kinds_of_types.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ string-literal types with non-string-literal types freely:
397397
398398
String literal types are never needed in ``# type:`` comments.
399399

400+
String literal types must be defined (or imported) later *in the same
401+
module*. They cannot be used to leave cross-module references
402+
unresolved. (For dealing with import cycles, see
403+
:ref:`import-cycles`.)
404+
400405
.. _type-aliases:
401406

402407
Type aliases

0 commit comments

Comments
 (0)
0