3 ms·
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
by throwaway894345 4y 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”.
- bombolo 4y agoIt'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.