Hacker News new | past | comments | ask | show | jobs | submit login

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”.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: