Skip to content

Commit 26192cf

Browse files
Modifying comment instead
1 parent af89a8c commit 26192cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/source/cheat_sheet_py3.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Functions
8989
.. code-block:: python
9090
9191
from collections.abc import Iterator, Callable
92-
from typing import Union, Optional, reveal_type
92+
from typing import Union, Optional
9393
9494
# This is how you annotate a function definition
9595
def stringify(num: int) -> str:
@@ -222,11 +222,12 @@ When you're puzzled or when things are complicated
222222

223223
.. code-block:: python
224224
225-
from typing import Union, Any, Optional, TYPE_CHECKING, cast, reveal_type
225+
from typing import Union, Any, Optional, TYPE_CHECKING, cast
226226
227227
# To find out what type mypy infers for an expression anywhere in
228228
# your program, wrap it in reveal_type(). Mypy will print an error
229-
# message with the type; remove it again before running the code.
229+
# message with the type; remove it again before running the code, or
230+
# import reveal_type from typing_extensions or typing (on Python 3.11 and newer)
230231
reveal_type(1) # Revealed type is "builtins.int"
231232
232233
# If you initialize a variable with an empty container or "None"

0 commit comments

Comments
 (0)