Skip to content

bpo-46480: rephrase typing.assert_type docs #32069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ Functions and decorators

.. function:: assert_type(val, typ, /)

Assert (to the type checker) that *val* has an inferred type of *typ*.
Ask a static type checker to confirm that *val* has an inferred type of *typ*.

When the type checker encounters a call to ``assert_type()``, it
emits an error if the value is not of the specified type::
Expand Down
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,7 +2085,7 @@ def cast(typ, val):


def assert_type(val, typ, /):
"""Assert (to the type checker) that the value is of the given type.
"""Ask a static type checker to confirm that the value is of the given type.

When the type checker encounters a call to assert_type(), it
emits an error if the value is not of the specified type::
Expand Down