[Edu-sig] Design Patterns

Arthur ajsiegel at optonline.net
Sat Aug 27 15:23:05 CEST 2005



> -----Original Message-----
> From: Laura Creighton [mailto:lac at strakt.com]


> One nice thing about overwriting __getattr__ and __setattr__ is
> that when you are done you have something that fairly shrieks
> 'black magic here'.  Properties look innocuous. Some people go quite
> nuts with them, and use them whenever possible, as if there was
> something wrong with simple assignment in the first place. 

Yes. Yes.

And in that way can be a bit of a trap to those of us feeling our way.  A
trap I find I fell into a bit.

Which = in essence - is why I thought a discussion of the subject pertinent.

I have disagreed with an aspect of Python design, which in IMO consciously
obscures functions and concepts related to the copying of objects.  Guido
seems to feel strongly that too much visibility here encourages overuse by
novices.    

Maybe true. But I think the lesson inherent in "copy" is worth the risk.

IMO, the degree of visibility of properties is a clearer case of this kind
of issue.  Less upside to it.

Art 




More information about the Edu-sig mailing list