You need to use mypy or similar to not check it at runtime:
els: List[int]
To test it at runtime you can use typeguard s @typechecked annotation. For convenience you can also use Pydantic.