[patch] deprecation warnings branch
Robert Collins
robertc at robertcollins.net
Sun Jan 8 11:01:00 GMT 2006
On Sat, 2006-01-07 at 17:01 -0800, Robey Pointer wrote:
> On 5 Jan 2006, at 3:53, Robert Collins wrote:
>
> > This adds deprecated_method and deprecated_function decorators. Heres
> > how they work:
> >
> > @deprecated_function(zero_seven)
> > def get_bzr_revision():
> > """If bzr is run from a branch, return (revno,revid) or None."""
> > import bzrlib.errors
> > ...
>
> Why not just
>
> @deprecated_function(0.7)
>
> ? (Being a visual instead of verbal person, I tend to just skim over
> words like zero_seven at first glance.)
Three reasons:
- We have more flexability this way, we can alter the message as needed
for each symbol.
- It prevents typos being silently ignored.
- It prevents inconsistency like '0.7' vs '"0.7pre1"' sneaking in
without it being obvious.
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/20060108/3eafa1bc/attachment.pgp
More information about the bazaar
mailing list