Duncan Booth <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

>> >>> def f():
>>      class C(object):
>>           def __init__(self):
>>                self.a = 'a'
>>      return C()
>> 
>> >>> x = f()
>> >>> x.a
>> 'a'
>> >>> y=f.C()
>> 
> 

Of course there's this:

>>> def f():
...  class C(object):
...       def __init__(self):
...            self.a = 'a'
...  return C()
...
>>> x = f()
>>> x.a
'a'
>>> y=x.__class__()
>>> y.a
'a'
>>> type(y) == type(x)
True

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to