Re:Please fix your Python decorators
by jdmichal on Monday August 01, 2016 @05:52PM
(#12206337)
Define a function to do the same and call that at the end of every method? These don't seem that different to me:
EDIT: In fact, I think the above succinctly hits on lotsoflumens' point. The latter clearly obfuscates the fact that an error check is performed behind the decorator. The former makes it very clear that something is happening to the return value before it leaves.
[ Parent
| on HN ]
There are no comments on this comment yet.