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

I've only really ever needed one decorator. The lovely @fuckit from fuckit. Tells your code to ignore all errors and keep on truckin.

Great for prod if an error is unnacceptable

(or more realistically, web scraping where you just don't care about one off errors)



Does it just wrap the code in a context manager where __exit__ returns True or something?


I'd imagine it's just a try/except wrapper with a funny name.


It's not just a try/except wrapper, it's a try/except wrapper for every single statement individually in a given class or function :)

It has some ast stuff built in.

@fuckit

def this_is_fine(garbage_in):

   x = 1 / 0
   return "garbage_out"

this_is_fine("") ### Returns "garbage out"




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

Search: