fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] @needs_host decorator trashes function signature on func


From: Jeff Forcier
Subject: Re: [Fab-user] @needs_host decorator trashes function signature on functions it decorates
Date: Wed, 9 Sep 2009 17:45:23 -0400

Hi Matt,

I'd love to use that module, actually. Wish I'd been aware of it
earlier; the problem you mention caused a real headache for me because
of how it kills Sphinx API autodoc for any internal functions which
are decorated. Wasted some brain cycles trying, and failing, to solve
that on my own, and currently have to restate the signature for said
functions, within the RST doc files.

So thanks for the heads-up! Yes, it's an extra dependency, but
assuming I try it out and it's the real deal, I think it's probably
worth it, especially since it's written by a name I recognize and
respect.

Not sure if this change will make into 0.9.x or not, will have to
think about it. Since it doesn't affect the public API I can probably
slot it into 0.9.1.

Best,
Jeff

On Wed, Sep 9, 2009 at 3:42 PM, Matthew Wilson <address@hidden> wrote:
> 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 mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]