Skip to content

Commit add9931

Browse files
Update common_issues.rst: I guess you can't use py:data like that
1 parent f1855ec commit add9931

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/source/common_issues.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,11 @@ to see the types of all local variables at once. Example:
510510
if you don't import them, then they don't exist at runtime! Therefore,
511511
you'll have to remove any ``reveal_type`` and ``reveal_locals`` calls from your program
512512
or else Python will give you an error at runtime about those names being undefined.
513-
Alternatively, you can import ``reveal_type`` from :py:data:`typing_extensions`
514-
(or, in more recent versions of python, from :py:data:`typing`) so its name will be defined at runtime.
515-
There is no analogous fix for ``reveal_locals``. It simply must be removed from the code before the code is run.
513+
Alternatively, you can import ``reveal_type`` from ``typing_extensions``
514+
(or, in more recent versions of python, from ``typing``)
515+
so its name will be defined at runtime.
516+
There is no analogous fix for ``reveal_locals``.
517+
It simply must be removed from the code before the code is run.
516518
(Although, technically, if you really didn't want to remove those calls, you could use
517519
``if not typing.TYPE_CHECKING: reveal_locals = lambda: None``
518520
or similar to define the function to something else at runtime.)

0 commit comments

Comments
 (0)