bokr at oz.net
Wed Feb 12 04:27:47 CET 2003
On Wed, 12 Feb 2003 00:34:40 GMT, jef.mangelschots at iname.com (Jef Mangelschots) wrote:
>I want to nest objects of different types.
>I tried this in the following example, but I get an error (see below).
>What am I doing wrong ?
I'm not sure what you are doing, but you got the error
because you forgot to use "self."
(The bare "aggregate" only created a local binding in the
__init__ method, not an attribute of the instance bound to self).
> c1_1 = ""
> c2_1 = ""
> def __init__(self):
> aggregate = C1()
self.aggregate = C1()
More information about the Python-list