Opened 12 years ago
Closed 12 years ago
#462 closed enhancement (fixed)
Replace _make_safe by functools.wraps
Reported by: | Elrond | Owned by: | Jakob Kramer |
---|---|---|---|
Priority: | trivial | Milestone: | 0.3.1 |
Component: | programming | Keywords: | bitesized |
Cc: | Parent Tickets: |
Description
To make decorators nicer, MediaGoblin has a tiny tool called _make_safe() in decorators.py.
But what this helper tool does, is actually in the standard library!
It's called functools.update_wrapper
(1)
There's also a nicer version called functools.wraps
(2)
So replace all instances of _make_safe by one of those two.
(1) http://docs.python.org/library/functools#functools.updat_wrapper
(2) http://docs.python.org/library/functools#functools.wraps
Change History (4)
comment:1 by , 12 years ago
Keywords: | bitesized added; bite-sized removed |
---|
comment:2 by , 12 years ago
Milestone: | → 0.3.1 |
---|---|
Owner: | set to |
Status: | new → accepted |
comment:3 by , 12 years ago
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Looks good. I merged it! Thank you! :)
Patch