Idiomatic algebraic data types in Python with dataclasses and Union
blog.ezyang.com