On Jun 2, 6:21 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Jun 3, 9:41 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > > Here's what I think Python should have. I think it should have a > > keyword, something like "priv," to identify data or functions as > > "private." > > As I stated earlier in this thread, if you want a public interface and > a private implementation, rather than adding another language feature > why not just separate them into two classes? This is exactly what the > Bridge pattern provides and would clearly denote your intention in the > code.
Yes, that looks interesting, but I think it has a couple of drawbacks. First, it requires another completely separate class for the "implementation" (although perhaps that could be a nested class). Secondly, I think it essentially just adds a sort of inner namespace through which the "private" data is accessed. That might be a good idea, but I don't think it's quite the same as encapsulation. -- http://mail.python.org/mailman/listinfo/python-list