Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Versus a sort of:

my_type = my_list | my_object

?

You can see why this is better :-)



I'd always return a list. Makes the client code simpler.


You would. But not every input comes from you :-)


All I can say is that it is certainly neat :)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: