D
Dan Sommers
However in python, there is no harm in accessing the attributes
directly. You can change the implementation whenever you like, and
change the attributes into property()s and the users will never know.
[ ... ]
Read only attributes are easy to understand, unlikely to go wrong and
faster than getBlah() accessor methods.
Writable attributes I think are good candidates for methods though.
Looking inside an object is one thing but changing its internal state
is another and should probably be done through a defined interface.
I wish I'd said it that well in the first place myself.
Regards,
Dan