> >-----Original Message----- > >From: [EMAIL PROTECTED] > >[mailto:[EMAIL PROTECTED] On Behalf Of Michael Tobis > >objects than values. > > > >So, is there a problem with wrapping them thus: > > > >### > >class mcx(object): > > > > def __init__(self,val): > > self.val = complex(val) > > > > def __add__(self,other): > > """ and similarly for most other special methods """ > > return self.val.__add__(other)
>### > > > >I think Arthur would duckishly call this a mutable complex > >type and others would more formally call it an object > >containing a reference to an immutable complex type and we > >could all live happily ever after. Not so easy, I'm afraid. If I am understanding correctly the implementation that you are suggesting is exactly the one I had one generation ago. Kind of the UserArray solution. No? And I can't easily explain why I felt the need to push it a step further - to in fact having a more truly full implementation of complex numerics contained *as* my object - not as an attribute of it. But there were reasons. Some more practical, more less. Art _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig