Tomi Lindberg wrote: > 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)?
def f():
class C(object):
def __init__(self):
self.a = 'a'
f.C = C
return C()
>>> f.C
<class '__main__.C'>
> And yes, I think this is one of those times
> when the real question is why :)
Definitely ;)
--
http://mail.python.org/mailman/listinfo/python-list
