From 351fec7708d3a6d9b33c6b03feb4f41efca7972e Mon Sep 17 00:00:00 2001 From: Bhuvansh855 Date: Fri, 15 May 2026 14:43:09 +0530 Subject: [PATCH] docs: fix typo and grammar in type narrowing guide --- docs/guides/type_narrowing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/type_narrowing.rst b/docs/guides/type_narrowing.rst index f900775cf..c359d9314 100644 --- a/docs/guides/type_narrowing.rst +++ b/docs/guides/type_narrowing.rst @@ -63,7 +63,7 @@ For example:: print(f"{x} is not a cardinal direction") A ``TypeGuard`` function looks similar and is used in the same way, but the -type narrowing behavior is different, as dicussed in :ref:`the section below `. +type narrowing behavior is different, as discussed in :ref:`the section below `. Depending on the version of Python you are running, you will be able to import ``TypeIs`` and ``TypeGuard`` either from the standard library :py:mod:`typing` @@ -143,7 +143,7 @@ Here is an example of a correct ``TypeIs`` function for a more complicated type: :py:data:`typing.TypeIs` and :py:data:`typing.TypeGuard` are both tools for narrowing the type of a variable based on a user-defined function. Both can be used to annotate functions that take an argument and return a boolean depending on whether the input argument is compatible with -the narrowed type. These function can then be used in ``if`` checks to narrow the type +the narrowed type. These functions can then be used in ``if`` checks to narrow the type of a variable. ``TypeIs`` usually has the more intuitive behavior, but it