diff --git a/docs/source/type_narrowing.rst b/docs/source/type_narrowing.rst index 230c40b30894..697a1519a603 100644 --- a/docs/source/type_narrowing.rst +++ b/docs/source/type_narrowing.rst @@ -400,11 +400,11 @@ Mypy supports TypeIs (:pep:`742`). A `TypeIs narrowing function `_ allows you to define custom type checks that can narrow the type of a variable -in `both the if and else _` +in `both the if and else `_ branches of a conditional, similar to how the built-in isinstance() function works. TypeIs is new in Python 3.13 — for use in older Python versions, use the backport -from `typing_extensions _` +from `typing_extensions `_ Consider the following example using TypeIs: