Clarify use of underscores in HACKING
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Jul 18 15:17:09 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian Clatworthy wrote:
> This patch is a small change to HACKING to better reflect the convention
> used around underscores. I had been using an underscore to mean
> "internal to this module" and a lack thereof to mean "external to this
> module" when Robert explained to me that underscore really means
> "internal to bzrlib".
I understand it as analogous to the "protected" keyword in C++. These
symbols may be used by subclasses, but should not be used from outside
their class.
Yes, Tree._iter_changes is a shining exception. There are a few others,
too. But in general, we should not be using _members outside their class.
1. Such members are subject to change
2. If we need to use such a member outside its class, it's reasonable to
expect that other bzrlib users will also need this. Therefore, we
should provide something stable for everyone.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGniDl0F+nu1YWqI0RAnPwAJ95CcHdD4tYNMi707FepfmYcjXM0gCeKGtd
j3g5b4WZM6acbOWX9kyKDaE=
=xGFf
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list