How do these Java concepts translate to Python?
Jeff Schwab
jeffrey.schwab at rcn.com
Fri Aug 12 00:39:04 EDT 2005
Ray wrote:
> 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, but technically
>>speaking, there are no public, protected, or private things.
>
>
> OK, thanks. How about static members and instance members? Seems that
> in Python everything is class-wide?
You can define instance data in the __init__ method.
def __init__(self):
self.instance_member = 0;
More information about the Python-list
mailing list