T
Tomi Lindberg
Hi,
With the following function definition, is it possible to
create an instance of class C outside the function f (and if
it is, how)? And yes, I think this is one of those times
when the real question is why
class C(object):
def __init__(self):
self.a = 'a'
return C()
Traceback (most recent call last):
File "<pyshell#22>", line 1, in -toplevel-
y=f.C()
AttributeError: 'function' object has no attribute 'C'
With the following function definition, is it possible to
create an instance of class C outside the function f (and if
it is, how)? And yes, I think this is one of those times
when the real question is why
class C(object):
def __init__(self):
self.a = 'a'
return C()
Traceback (most recent call last):
File "<pyshell#22>", line 1, in -toplevel-
y=f.C()
AttributeError: 'function' object has no attribute 'C'