Hacker News new | ask | show | jobs
by throwaway894345 1285 days ago
I mean, it depends on what you mean by “type”. A list of some Protocol type (what other languages call “interfaces”) is still a homogenous list even though the concrete types are heterogeneous. This is almost always what you want when you’re thinking of “a heterogeneous list”.
1 comments

It's not unheard of to have unions and a couple of if isinstance.

In fact it's why in python they even have the | operator between types nowadays.