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

Antoon Pardon apardon at forel.vub.ac.be
Fri Sep 30 04:52:49 EDT 2005


Op 2005-09-30, Steve Holden schreef <steve at holdenweb.com>:
> Antoon Pardon wrote:
>> Op 2005-09-29, Steve Holden schreef <steve at holdenweb.com>:
>> 
>> 
>>>Think about it: we have a language that has an eval() function and an 
>>>exec statement, and people are concerned that some service consumer 
>>>shouldn't be allowed to go poking around inside namespaces? What do we 
>>>have to do, put up signs saying "do not stab yourself with a knife"? If 
>>>people want control without discipline (which is effectively what 
>>>private and the like purport to do) then Python just may not be your 
>>>language ...
>> 
>> 
>> Well I have the following reasons not to like the current python way:
>> 
>> 1) Beginning all your private variables with an underscore is like
>> starting all your integers with an 'i' or all your dictionary with
>> a 'd' etc.
>> 
> Well, surely anyone who's ever used Fortran knows that god is real 
> unless explicitly declared to be integer. The convention wasn't meant 
> for people who can't be safely allowed outside on their own.

What point do you have? That don't have to bother about this one
and can just skip the underscore on the attribute I feel as
private?

>> 2) The editor and font I use make it hard to see underscores. They
>> usually seem to belong more to the line below than to the actual
>> lines.
>> 
> So use a different editor and/or font, for Pete's sake.

Look, if defenders of python can use editor and font characteristics
to oppose the introduction of certain features in python, i can use
those arguments too when it suits me.  Beside almost all fonts
have this characteristic.

-- 
Antoon Pardon



More information about the Python-list mailing list