python development practices?

Darren Collins collinda at nortelnetworks.com
Wed Oct 31 00:33:08 EST 2001


> i don't think data hiding's purpose is to keep rogue programmers in
> line.
...
> ... since the entire code of the class is
> exposed (unless you split off a portion of it into a hidden base
> class), it's doubly enticing to use stuff you're not supposed to.
>
I don't follow your reasoning here. These statements seem contradictory to
me.

If people can see that something is supposed to be private, but they
absolutely need access to it, then they have just discovered an interface
problem. They can either fix the interface or put a quick hack in their code
to to work around it by accessing the 'private' member. But they put in the
hack knowing that they are breaking the original designer's intentions, so
they're on their own. It is nice that you can do this when you really need
to, though.





More information about the Python-list mailing list