HAP-python icon indicating copy to clipboard operation
HAP-python copied to clipboard

Consider using "wrapt" for decorators.

Open schinckel opened this issue 7 years ago • 1 comments

The AsyncAccessory stuff looks interesting, but I note that you are writing some decorators in there.

GrahamDumpleton wrote a series of blog posts about writing decorators, the TLDR of which is that you should use his wrapt package when writing them to ensure they work reliably, and don't change the name/signature of the object they are wrapping.

https://github.com/GrahamDumpleton/wrapt/tree/master/blog

schinckel avatar Apr 28 '18 11:04 schinckel

I don't think that this is that big of a deal, but adding @functools.wraps(wrapped) woun't hurt either. @schinckel Do you want to do the change and prepare the PR?

cdce8p avatar Apr 28 '18 20:04 cdce8p