Kalle Anke wrote:
> I'm coming to Python from other programming languages. I like to
> hide all attributes of a class and to only provide access to them
> via methods. 
(...)
> Is this the "Pythonic" way of doing it or should I do it in a different
> way or do I have to use setX/getX (shudder)

the pythonic way is to use "property" (as others have already explained)
only when is *stricly necessary*. this may clarify things up:

"Python Is Not Java"
<http://dirtsimple.org/2004/12/python-is-not-java.html>

HTH.

-- 
deelan <http://www.deelan.com>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to