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

I created a decorator for validating arguments for functions that are receiving arguments from user input. It eliminated _so much_ boilerplate code.

I use decorators quite a bit. The feature is incredibly powerful. Once you find @lru_cache, you start realizing how many ways you can take advantage of the feature.



@cached_property is the new lru_cache for me, much of the time :^)




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

Search: