On Tue, Apr 16, 2013 at 8:12 AM, Rotwang <sg...@hotmail.co.uk> wrote: > Traceback (most recent call last): > File "<pyshell#2>", line 1, in <module> > class C(type(lambda: None)): > TypeError: type 'function' is not an acceptable base type > > > and I don't think that FunctionType would be considered an "internal > detail", would it? Not that I'd cite the fact that not all types can be > inherited from as evidence that types and classes are not synonyms, mind.
Actually, I'm not sure how you'd go about inheriting from a function. Why not just create a bare class, then assign its __call__ to be the function you're inheriting from? ChrisA -- http://mail.python.org/mailman/listinfo/python-list