Newbie asks about static variables...

Moshe Zadka moshez at math.huji.ac.il
Sun May 9 11:24:46 EDT 1999


On Sat, 8 May 1999, Tim Peters wrote:

> [William Tanksley, discovers that _eggs can be imported explicitly from
> module spam, as in spam._eggs, while "from spam import *" doesn't leave
> _eggs on anyone's face]
> 
<snipped my answers>
<and tim's enhancements of them>

<Then I said>
> > It never did (and, Guido willing, never will) support True Data
> > Hiding(TM) or any such nonsense:

<to which tim answered>
> Oh, it did at one time.  The only keyword ever *removed* from the language
> is "access", which used to support a pile of serious visibility
> restrictions.  It was mostly contributed code, uglified the implementation
> rather horridly, and Guido never liked it.  I'm not sure it was even
> advertised, but the code was there for several years.

Wow, history can be scary! I never imagined there was such a thing in
Python. Can you give us more versional history? (I.e., which versions
had that horrible beature)

<back to tim>
> Back when the easily-circumvented "__" convention for mangling class-pvt
> names was invented, Guido was provoked into revealing the true model for
> Python's data-hiding philosophy:
> 
> [GvR, circa 1996]
> > It's called "advisory locking."  It was pioneered for bike locks in
> > Amsterdam :-)

Yes. This is the one area Python and Perl do the same on (not
coincidently), and it's the right thing.

notice-that-legalising-class-abuse-and-drug-abuse-were-both-legalized-in-
amsterdam-which-is-probably-good-ly y'rs, Z.

(Note: any discussions about drug abuse do *not* belong on c.l.py -- mail
me directly if you wish)

forstalling-political-flamewars-on-my-favourite-group-ly y'rs, Z.
--
Moshe Zadka <mzadka at geocities.com>. 
QOTD: My own exit is more likely to be horizontal then perpendicular.






More information about the Python-list mailing list