Best way to control assignment to attribute?

Batista, Facundo FBatista at uniFON.com.ar
Wed Feb 4 10:27:31 EST 2004


frank at chagford.com wrote:

#- I want to control the assignment of a value to an attribute. Instead
#- of allowing it to be changed directly, I want to enforce 
#- that a method
#- is called, which will perform the assignment subject to various
#- checks.

Use property().

http://www.python.org/2.2/descrintro.html#property

.	Facundo




More information about the Python-list mailing list