[TriZPUG] Why Push for Python?

Chris Calloway cbc at unc.edu
Wed May 14 01:49:41 CEST 2014


On 5/13/2014 2:18 PM, Jim Allman wrote:
> http://digitalhumanities.org/answers/topic/whats-wrong-with-python#post-534

Oh my, that thread is so awful it makes me want to explode. It's like 
listening to Wordpress people. Ruby is more object oriented than Python 
my bottom. We just have the good taste not to do every task via monkey 
patching.

So, the lack of the "private" and "protected" keywords came up at 
project night last week and apparently needs to be addressed. Python has 
the same functionality, with even more granularity than C++ or Java, 
through __getattribute__, __setaattr__, and __delattr__. We have the 
"property" built-in when we want to make that explicit on an attribute 
by attribute basis and can use it as a decorator. In Java it's a keyword 
because Java was designed to download "applets" into browsers to execute 
protected, sandboxed, and compiled code, making the whole Java "security 
model" necessary. It's not that you can't do privacy in Python. It's 
that we don't use a keyword to do it because we're not flinging applets 
back and forth between untrusted hosts and untrusted clients.

It's also related to the thing that Plone newbies find so confusing. You 
think you set the state or the owner "attribute" on some Plone object 
when you really needed to call a property manager to usher you through 
security. That's way more sophisticated than what simple "private" and 
"protected" bludgeons do. In Python we have better security granularity 
through many domains, not just on the get, set, and delete per attribute 
axis, but also on the who, and when, and how axes. And we don't have to 
register keys to do it unless we need to.

-- 
Sincerely,

Chris Calloway http://nccoos.org/Members/cbc
office: 3313 Venable Hall   phone: (919) 599-3530
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599


More information about the TriZPUG mailing list