Automatic Generation of Python Class Files
steven.bethard at gmail.com
Wed Oct 24 00:20:14 CEST 2007
Bruno Desthuilliers wrote:
> Steven Bethard a écrit :
>> Bruno Desthuilliers wrote:
>>>> I guess as long as your documentation is clear about which
>>>> attributes require computation and which don't...
>>> Why should it ?
> I believe we simply disagree on weither properties should be used when
> it makes sens (from a semantic POV, which doesn't prevent common sens,
> thanks) or if they should be restricted to refactoring-life-saver. Now
> since the second use implies that some attributes-looking properties of
> an object may not be what they looks like - and even worth, may suddenly
> become (a little bit) more costly without client code being warned - I
> don't see what's your problem with the first one.
I said those kind of expectation violations should be documented, and
you said "Why should it?" I gather you really only meant the "Why
should it?" in the situation that the computation is extremely minimal.
I can understand that, but I'd still like it documented for any
objects I use.
> Ho, and wrt/ training and expectations, I'm afraid you have to live with
> the fact that computed attributes (either properties and custom
> descriptors) are alreay widely used. FWIW, may I remind you that a
> method is actually a callable returned by a computed attribute ?-)
Yep. And it's documented. ;-)
More information about the Python-list