Why does python not have a mechanism for data hiding?

alex23 wuwei23 at gmail.com
Mon Jun 2 21:21:18 EDT 2008


On Jun 3, 9:41 am, "Russ P." <Russ.Paie... at gmail.com> 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.



More information about the Python-list mailing list