[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] @needs_host decorator trashes function signature on functions
From: |
Matthew Wilson |
Subject: |
[Fab-user] @needs_host decorator trashes function signature on functions it decorates |
Date: |
Wed, 9 Sep 2009 15:42:39 -0400 |
Hi --
Initially, the get function looks like this when defined:
@needs_host
def get(remote_path, local_path):
"""
Download a file from a remote host....
"""
But after needs_host has its way with it, those helpful parameter
names are replaced by *args and **kwargs:
>>> from fabric import api
>>> import inspect
>>> inspect.getargspec(api.get)
([], 'args', 'kwargs', None)
There's a decorator module [1] I'm fond of that preserves the function
signature. Might you accept a patch that uses that? Fabric would
have to include that module as a dependency.
[1] http://pypi.python.org/pypi/decorator/
--
W. Matthew Wilson
address@hidden
http://tplus1.com
- [Fab-user] @needs_host decorator trashes function signature on functions it decorates,
Matthew Wilson <=