Will python never intend to support private, protected and public?

Paul Rubin http
Fri Sep 30 08:23:35 EDT 2005


Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> > It's not easy if the base classes change after you check your code in.
> > You shouldn't need to know about that if it happens.  Modularity, remember?
> 
> Yes. And if you are relying on a public method in a class, and somebody
> dynamically modifies that public method, your code will stop working too.

I'm not talking about dynamic anything.  I'm talking about a normal
software project where there are multiple people working on the code.
You write a class and carefully make sure that none of its private
variables collide with superclasses in modules that it imports.  You
check in your code and go do something else.  Then the person
maintaining the superclasses goes and changes how they use their
private variables.  He doesn't look at your code since his modules
don't import yours.  But now both your code and his are broken.

> perhaps that mathematical certainty is appropriate for
> your ICBM control system or nuclear reactor, but it is a needless
> affectation for (say) a word processor. 

Why on earth would you want to unnecessarily introduce random bugs
into a word processor or anything else?  And what happened to the
marketing claims that Python was good for critical applications?
Maybe I should post your disclaimer every time one of those
discussions comes up.  "Python is ok for word processors but no good
for anything important".  Heck, some people think word processors are
important.



More information about the Python-list mailing list