Thanks. Ben Finney wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > Of course, whenever you then set mystr = 'a string' > > ... you're instantiating a 'str' object, since that's what the syntax > you use will do. > > > you loose the extra goodies that I have attached in the > > subclass. > > Because you haven't created an object of that subclass. >
naturally. > > The syntax used to make the object assigned to 'foo' is just a > shortcut for the syntax used to assign to 'bar'. If you want to > instantiate anything else, you need to use that explicit syntax, such > as for the object assigned to 'baz'. > > If you're hoping that "subclass" means "modify the behaviour of the > original class", you're mistaken. It makes a *new* class that has > behaviour *inherited from* the original class. Nah. I was hoping that I hadn't muffed the implementation and there was a more Pythonic way of doing what I wanted. Sounds like I've gotten things mostly right from the get go. which is reassuring for a newbie. using __set__ is the correct way to hide the vectoring to the __new__ assignment... no further shortcuts. thanks again t4 -- http://mail.python.org/mailman/listinfo/python-list