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

I've used decorators mainly to retry a function if it throws an exception, like retrying DNS queries multiple times, etc. I've never got a chance to do more with them, but this article gives me an incentive to try more.


Yep. I do the exact thing for a lot of network related things (dns lookups, http requests). I use this nifty library: https://github.com/jd/tenacity


Wow, both terrific tips, thanks!


That never crossed my mind. Neat trick!




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

Search: