Closed Terminus-IMRC closed 5 years ago
Without functools.wraps, the name and the doc of a function to be decorated will be lost. This PR fixes that.
functools.wraps
Example code:
#!/usr/bin/env python3 from videocore.assembler import qpu @qpu def qpu_code(asm): nop() exit(interrupt = True) print(qpu_code.__name__)
Before the change in this PR, the code prints decorated, which is the name of the decorator. After the change, the output will be qpu_code, which is desired.
decorated
qpu_code
Thanks!
Thanks for merging!
Without
functools.wraps
, the name and the doc of a function to be decorated will be lost. This PR fixes that.Example code:
Before the change in this PR, the code prints
decorated
, which is the name of the decorator. After the change, the output will beqpu_code
, which is desired.