API breakages - file bugs / update HACKING.txt ?
John Arbash Meinel
john at arbash-meinel.com
Thu May 22 15:36:38 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Toshio Kuratomi wrote:
| Martin Pool wrote:
|> The first does not seem so practical: not adding new APIs during that
|> period would limit our development.
| Err... Perhaps I could have been clearer. API additions aren't the
| problem. Removing of API, new mandatory arguments to methods, etc are.
| So you could add new API for six month and deprecate methods that they
| replace/need to get rid of in general. And then have one release that's
| a housecleaning release where incompatibilities saved up for six months
We rarely remove an API completely or add new mandatory arguments without
deprecating. It is something I know I always look for in a review. I think what
is hurting Jelmer is new non-mandatory arguments. Because the "client" code is
supplying them, and since he overrode the function and doesn't have it... breakage.
It is one bit that I wish Python had better support for. You can do "func =
getattr(obj, 'func_name', None)" to figure out if an object has a given
attribute/function etc. However, there is no simple way to find out if a
function supports a given argument. (Partly because they can take *args, and
**kwargs and decide later on.)
You could do "try: foo(bar=XXX) except TypeError:" but is the function
guaranteed to not have mutated anything by the time you get the exception?
(also, TypeError occurs with the wrong number of arguments, and if you do
something like int(object()))
bzr-svn is held to a higher standard because it is doing more invasive things.
We also, honestly, have decreased our api stability in the past few months. If
you just look at where we start having API CHANGES.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar