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

A dispatch dictionary covers many of the typical usecases? https://alysivji.github.io/quick-hit-dictionary-dispatch.htm...

Though I have missed switch statements a few times in Python, when implementing state machines - for parsing or sensor/actuator logic. Though these tended to be quite simple and not performance-critical, so a if/elif sequence was just fine.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: