3 ms·
I could turn: def make_money(): blockchain_pyramid_scheme() into: @with_jazz_hands def make_money(): blockchain_pyramid_scheme()
by mintplant 9y ago
I could turn:
def make_money():
blockchain_pyramid_scheme()
into:
@with_jazz_hands
def make_money():
blockchain_pyramid_scheme()
or equivalently:
def make_money(*args, **kwargs):
with_jazz_hands(make_money_impl, *args, **kwargs)
def make_money_impl():
blockchain_pyramid_scheme()
Both ways wrap with_jazz_hands around make_money without altering the call sites of make_money.
- RubyPinch 9y agoand then suddenly, your signature goes from `f()` to `f(args,*kwargs)`, you lose all of make_money's documentation too
- pseudalopex 9y agoThere's a decorator for that: https://docs.python.org/3/library/functools.html#functools.wraps https://docs.python.org/3/library/functools.html#functools.w...