[patch] deprecation warnings branch
John Arbash Meinel
john at arbash-meinel.com
Wed Jan 11 13:04:40 GMT 2006
Jamie Wilkinson wrote:
> This one time, at band camp, Robert Collins wrote:
>
>>@deprecated_function(zero_seven)
>>def get_bzr_revision():
>> """If bzr is run from a branch, return (revno,revid) or None."""
>> import bzrlib.errors
>> ...
>>
>>results in the following pydoc output:
>>Help on function decorated_function in bzrlib:
>>
>>bzrlib.get_bzr_revision = decorated_function(*args, **kwargs)
>> If bzr is run from a branch, return (revno,revid) or None.
>>
>> This function was deprecated in version 0.7.
>>
>>I'm not sure how to change the 'bzrlib.get_bzr_revision =
>>decorated_function(*args, **kwargs)' line - that seems a little ugly to
>>me right now.
>
>
> FWIW this also affects the output of build-api, all decorated functions
> appear without documentation and their signature as (self, *args, *kwargs),
> which suck because after tracing the structure in the browser you have to go
> open the file in an editor anyway :) (Better go learn ctags I guess :)
>
>
If you look at Andrew Bennet's post, they have some code for dynamically
generating the wrapped function, which can help.
But it might be easiest to do
wrap_func.__doc__ = signature + orig_func.__doc__
Would that be sufficient? If you saw
my_function = wrap(self, *args, **kwargs):
my_function(self, foo, baz=None)
stuff about my_function
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060111/f859405a/attachment.pgp
More information about the bazaar
mailing list