Does altering a private member decouple the property's value?

Ethan Kennerly kennerly at finegamedesign.com
Fri Jun 22 02:45:55 EDT 2007


Thanks for the help!  Using the "class name (object)" syntax fixed my
problem.

Usually, I don't need properties, but in the case of a dependent attribute,
I used a set method of a property to update that dependent attribute.  I
have a stopwatch class with a time limit property.  When the time limit is
changed, the dependent attribute, remaining time, should also change.

I am having to unteach myself some of the defensive programming techniques
in C++, such as using name mangling to ensure privacy, when privacy is not
the most important criterion.  For prototyping, starting public and going
"private" later is more efficient when refactoring.  And since properties
have the same access signature as a public member, it can be done without
changes to the client.

-- Ethan





More information about the Python-list mailing list