Accessors in Python (getters and setters)

Gerhard Fiedler gelists at gmail.com
Sat Jul 15 18:49:01 EDT 2006


On 2006-07-15 12:04:20, mystilleef wrote:

> State - behavior is not something I made up, so it isn't subjective. It
> is a common term used in OO literature. In fact, the only reason I used
> it is because I thought is was common knowledge. 

Of course. But your association of state with attributes and behavior with
methods is arbitrary to a specific implementation. Of course you probably
will have always something like attributes to store state, but you may
trigger behavior just as well through state changes as you may trigger it
through method calls or other means. (Remember, this is about the public
API, not about implementation details.)

Gerhard




More information about the Python-list mailing list