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

An issue here is that you're going to reset your cache after every lookup instead of only on cache miss.


Hm? How come? `or` is short-circuiting in the sense that when we have `a() or b()`, b() is only called if a() returns something falsy. Where would the issue arise?

Sure, abusing or in this way might seem hackish, but I feel like it's a net win for readability.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: