weissjeffm / multimethods

Multimethods for Python, inspired by Clojure
Other
16 stars 3 forks source link

decorators are squashing docstrings #2

Closed weissjeffm closed 10 years ago

weissjeffm commented 10 years ago
16:35 <smyers> jweiss, speaking of multimethods, I noticed that the multimethod decorators are squashing docstrings. While you're tinkering in there, could you steal __doc__ from the function being wrapped and stick it on the wrapper?
16:36 <jweiss> smyers: yep, i noticed that functools (i think) has a nice "wrap" function that steals the important stuff from the function being wrapped and adds it to the outer one.
16:36 <smyers> There's also this guy, if it's helpful: https://docs.python.org/2.7/library/functools.html#functools.wraps
weissjeffm commented 10 years ago

Fixed in ff41317f21ff9abe0733e1adcfe16b5f6d3be595