MCPcopy
hub / github.com/pydantic/pydantic / assert_never

Function assert_never

pydantic/v1/utils.py:740–747  ·  view source on GitHub ↗

Helper to make sure that we have covered all possible types. This is mostly useful for ``mypy``, docs: https://mypy.readthedocs.io/en/latest/literal_types.html#exhaustive-checks

(obj: NoReturn, msg: str)

Source from the content-addressed store, hash-verified

738
739
740def assert_never(obj: NoReturn, msg: str) -> NoReturn:
741 """
742 Helper to make sure that we have covered all possible types.
743
744 This is mostly useful for ``mypy``, docs:
745 https://mypy.readthedocs.io/en/latest/literal_types.html#exhaustive-checks
746 """
747 raise TypeError(msg)
748
749
750def get_unique_discriminator_alias(all_aliases: Collection[str], discriminator_key: str) -> str:

Callers 3

_get_alias_nameMethod · 0.85
field_is_presentMethod · 0.85
_coerce_itemsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected