"johnf" <[EMAIL PROTECTED]> wrote > def someMethod(): > class MyClass(object): > ..... > if something: > ..... > return someval
Did you try it? >>> def f(): ... class C: pass ... return C ... >>> def g(x): ... class C: pass ... if x == 42: ... return C ... else: return 666 ... >>> c = f() >>> c <class __main__.C at 0x7ff1bbfc> >>> It works for me... -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor