Declarative properties
Dan Stromberg
dstromberglists at gmail.com
Fri Oct 12 16:15:40 EDT 2007
On Thu, 11 Oct 2007 18:42:16 +0000, Marc 'BlackJack' Rintsch wrote:
>> The "baggage" of possibly fixing (AKA "generalizing") how your attributes
>> are accessed is something you lug around while your deadline looms.
>
> Sorry I don't get it. If I want to customize the access to a "normal"
> attribute I simply turn it into a property.
You're right, properties are an intersting language feature. I wasn't
aware of them until today.
I'm not sure I believe they are better than disallowing public attributes
and requiring setters and getters, but they do appear to address the same
issue: the needless change in API when your internal representation
needs to change.
Apologies.
More information about the Python-list
mailing list