ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Underscore data hiding (was python development practices?)
by Martijn Faassen other posts by this author
Nov 1 2001 11:50PM messages near this date
Re: Underscore data hiding (was python development practices?) | Re: Underscore data hiding (was python development practices?)
Paul Rubin <phr-n2001d@[...].com>  wrote:
>  m.faassen@[...].nl (Martijn Faassen) writes:
> > Data hiding isn't there to prevent evil programmers from doing evil
> > things anyway; it's there to communicate intent and to prevent people
> > from tripping over problems. 

>  That's true a lot of the time, but it's not universally true.  In java
>  for example, data hiding is definitely intended to thwart evil
>  programmers, and any failure of the data hiding is considered a
>  security bug requiring an immediate patch.  The closest Python has to
>  that is the rexec mechanism.  I'd like it a lot if Python extended
>  such protection to private instance variables.

Well, I see this as a different mechanism. I don't see data hiding itself
as a security mechanism; it is an abstraction mechanism. I realize Java
combines the two, but Python doesn't.

Zope's through the web security model for instance features security
rather separate from data hiding; you can't access attributes that 
start with an underscore in through the web code. Other attributes can
be private or public depending on security declarations (besides the
brokeness that methods without docstring will automatically be considered
private).

I think there's an advantage in having your security infrastructure be
separate from your data hiding mechanism; it leads to less programmer
overhead in the abundant cases where such strict security is not necessary.
It also leaves one up to devise ones own security system that is more
suited to the needs at hand.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?
-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Peter Wang
Peter Hansen
Toby Dickenson
Tim Peters
Steve Holden
Steve Holden
Cliff Wells
Tim Peters
Martijn Faassen

Cliff Wells
Cliff Wells
Martijn Faassen
Martijn Faassen
Paul Rubin
Russell E. Owen
Barry A. Warsaw
Martijn Faassen
Peter Wang
Skip Montanaro
John Roth
David Bolen
Peter Wang
Peter Wang
Skip Montanaro
Chris Tavares
Darren Collins
David Bolen
Paul Rubin
Paul Rubin
Peter Wang
F Basegmez
Richard Jones

Richard Jones

Neal Norwitz
Graham Ashton
Peter Wang
Russell E. Owen
Skip Montanaro
Cliff Wells
Hung Jung Lu
Wade Leftwich
Peter Wang
Peter Wang


Peter Wang

Chris Gonnerman
Paul Rubin
Andrew Dalke
Paul Rubin
Luigi Ballabio
Paul Rubin
Tim Peters
John Roth
Paul Rubin
Richard Jones

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved