manstey wrote: > Hi, > > Is is possible to have two classes, ClassA and ClassB, and > setattr(ClassA, 'xx',ClassB), AND to then have ClassA.xx store an > integer value as well, which is not part of ClassB? > > e.g. If ClassB has two properties, name and address: > > ClassA.xx=10 > ClassA.xx.name = 'John' > ClassA.xx.address = 'Sydney'. > > etc? I've no idea if this is possible or desirable.
It's neither of both options. If you must, you can subclass int, and have additional properties. But then you can't do it like above, but instead must do: ClassA.xx = MyAddressInt(10) Diez -- http://mail.python.org/mailman/listinfo/python-list