On 07/20/12 14:30, Brock Pytlik wrote:
On 07/20/12 14:27, Shawn Walker wrote:
On 07/20/12 14:18, Brock Pytlik wrote:
On 07/19/12 19:46, Danek Duvall wrote:
Brock Pytlik wrote:
...

transport.py:

- I would put this change into image.py instead -- have a private
__verify_manifest() that called _verify_manifest(), caught the
exception, and returned true or false.
I can do that, but I think I have two issues with it. The first is that
then we're calling a protected method from another class. The second is
that I don't think _verify_manifest is an appropriate "public" interface
because it raises the exception and having the method verify_manifest
which returns true or false seemed more appropriate to me. If what I've
said here hasn't convinced you, let's talk offline and see if we can
reach a conclusion.

I don't follow the protected member argument; for Python, protected
really means "only classes that know each other should be calling
this; it's not a general public interface".
I don't follow your argument. Any two classes can "know each other." Can
you point me to the python docs that define this relationship? My
understanding was that, by convention just as class privacy is enforced
by convention, methods prefixed with a single underscore should only be
called by the class and its subclasses.

How else would I denote functions that I don't want the general public to call, but expect "friend" classes to? Ultimately, it's a shortcoming of Python that it doesn't offer a formal mechanism for this, but it is how I and others have used it in the pkg project.

-Shawn
_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to