Skip to content

Commit d14195d

Browse files
committed
Add infobox re: assert_type prior to Python 3.11
1 parent 1b1da7a commit d14195d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/reference/quality.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ then the following file tests ``foo.py``:
4444
4545
assert_type(bar(42), str)
4646
47+
.. note::
48+
49+
To use this feature on Python versions earlier than 3.11, you will need to
50+
import ``assert_type`` from ``typing_extensions`` (version 4.2 or newer).
51+
4752
Clever use of ``mypy --warn-unused-ignores`` can be used to check that certain
4853
expressions are or are not well-typed. The idea is to have valid expressions along
4954
with invalid expressions annotated with ``type: ignore`` comments. When

0 commit comments

Comments
 (0)