Class property with value and class

manstey manstey at csu.edu.au
Tue Dec 19 01:02:26 EST 2006


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.

thanks,
matthew




More information about the Python-list mailing list