Python Type Hints - How to Narrow Types with isinstance, assert, and literal https://adamj.eu/tech/2021/05/17/python-type-hints-how-to-narrow-types-with-isinstance-assert-literal/