[patch] deprecation warnings branch

Robert Collins robertc at robertcollins.net
Wed Jan 11 20:38:35 GMT 2006


On Wed, 2006-01-11 at 19:27 +1100, 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 :)

the docstrings should be correct on the deprecated though, because of
the work done.

I wonder if we grab the C module to preserve the prototype and make it
optionally built and used, if that would be troublefree for installs.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060112/8eef863b/attachment.pgp 


More information about the bazaar mailing list