How do these Java concepts translate to Python?

bruno modulix onurb at xiludom.gro
Fri Aug 12 10:55:40 CEST 2005


Devan L wrote:
> Fausto Arinos Barbuto wrote:
> 
>>Ray wrote:
>>
>>
>>>1. Where are the access specifiers? (public, protected, private)
>>
>>    AFAIK, there is not such a thing in Python.
>>
>>---Fausto
> 
> 
> Well, technically you can use _attribute to mangle it, 

__attribute would work better !-)

> but technically
> speaking, there are no public, protected, or private things.

Yes there are:
object.name is public
object._name is protected
object.__name is private

You don't need the language to enforce this, it's just a matter of
conventions.


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list