Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
srathi
on Jan 7, 2018
|
parent
|
context
|
favorite
| on:
Python decorators they don't tell you about
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.
sheraz
on Jan 7, 2018
|
next
[–]
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
creeble
on Jan 7, 2018
|
parent
|
next
[–]
Wow, both terrific tips, thanks!
mewwts
on Jan 7, 2018
|
prev
[–]
That never crossed my mind. Neat trick!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: