How do these Java concepts translate to Python?

Ray ray_usenet at yahoo.com
Thu Aug 11 23:00:46 EDT 2005


Hello,

I've been learning Python in my sparetime. I'm a Java/C++ programmer by
trade. So I've been reading about Python OO, and I have a few questions
that I haven't found the answers for :)

1. Where are the access specifiers? (public, protected, private)
2. How does Python know whether a class is new style or old style?
E.g.:

class A:
    pass

How does it know whether the class is new style or old style? Or this
decision only happens when I've added something that belongs to new
style? How do I tell Python which one I want to use?

3. In Java we have static (class) method and instance members. But this
difference seems to blur in Python. I mean, when you bind a member
variable in Python, is it static, or instance? It seems that everything
is static (in the Java sense) in Python. Am I correct?

Thanks in advance,
Ray




More information about the Python-list mailing list