property and virtuality

Diez B. Roggisch deets.nospaaam at web.de
Thu Mar 31 16:18:35 CEST 2005


> Great. I'll think about this and decide which is better - lamba or
> private functions. Lambda seems much
> shorter but it is not as clear why it is there. :-)

I did put comments above each property line - so one might argue that's
about the same effort as writing the method explicit. Alternatively, you
could introduce a naming scheme in the getters/setters that are supposed to
be overloaded so that it becomes clear - at least for someone knowing the
project. But that's true for the whole thingy :)
> Yes, I feel the same. Using a metaclass could be a small help but rather
> elaborate and probably much slower.

Certainly not much slower - that happens once, at class creation time - and
the results would even be faster, as you can skip the layer of indirection.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list