Why does python not have a mechanism for data hiding?

NickC ncoghlan at gmail.com
Wed Jun 4 07:29:38 EDT 2008


On Jun 4, 4:09 am, "Russ P." <Russ.Paie... at gmail.com> wrote:
> What is it about leading underscores that bothers me? To me, they are
> like a small pebble in your shoe while you are on a hike. Yes, you can
> live with it, and it does no harm, but you still want to get rid of it.

With leading underscores, you can see *at the point of dereference*
that the code is accessing private data. With a "this is private"
keyword you have no idea whether you're accessing private or public
data, because the two namespaces get conflated together.

I'll keep my pebble, thanks.

Cheers,
Nick.



More information about the Python-list mailing list