# Runtime type checking using parameterized types

**URL:** <https://discuss.python.org/t/runtime-type-checking-using-parameterized-types/70173>\
**Category:** Ideas\
**Created:** [November 4, 2024, 9:23pm UTC](https://discuss.python.org/t/runtime-type-checking-using-parameterized-types/70173 "2024-11-04T21:23:00Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![mikeshardmind](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/mikeshardmind/32/14381_2.png) [@mikeshardmind](https://discuss.python.org/u/mikeshardmind)\
**Post date:** [November 4, 2024, 11:53pm UTC](https://discuss.python.org/t/runtime-type-checking-using-parameterized-types/70173/9 "2024-11-04T23:53:32Z")

</div>

It would be unsafe to check parameterized generics without specific knowledge. Even in some cases with specific knowledge, you have to be careful to construct checks so that they _only_ work on the exact class being checked and no subclasses, see discussion about the unsafety of TypeIs here: [Problems with TypeIs - #46 by mikeshardmind](https://discuss.python.org/t/problems-with-typeis/55410/46), more complex libraries avoid this by parsing into a structured type rather than checking if a type looks like another type.

---

_[View the full topic](https://discuss.python.org/t/runtime-type-checking-using-parameterized-types/70173)._
