The goal here is to reduce potential confusion between
`assert_type(val, type)` and `assert isinstance(val, typ)`.
The former is meant to ask a type checker to confirm a fact, the latter
is meant to tell a type checker a fact. The behaviour of the latter more
closely resembles what I'd expect from the prior phrasing of
"assert [something] to the type checker".
.. 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::
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::