On Sun, Sep 1, 2013 at 6:10 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Java and C++ allow you to declare members as public, so it is *not true* > that calling methods is the only way to change members. If you accept > Steve Holden's (wrong) definition above, Java and C++ don't have > encapsulation either.
That said, though, when you consider the language ecosystem rather than just the language, there is a strong tendency for Java and C++ code to wrap everything up with functions (no public data members), whereas Python code is far more likely to have external code directly access data inside an object. You usually will find Java code calling methods to change members, whereas that's done in Python only when there's a need for it. ChrisA -- http://mail.python.org/mailman/listinfo/python-list