8 Jul
2007
8 Jul
'07
8:43 a.m.
Jonathan wrote at 2007-7-7 08:55 -0400:
... Just one caveat: you cannot define a class within an external method and then return an instance of that class (the routine that invoked the external method will not have any reference to the instance's class).
You can. You must, however, be aware that such classes are not picklable. The source of "External Method"s are read in ("execfile"d) and classes defined therein appear as if defined in the module "__main__". This confused the pickling mechanis as "__main__" is unable to recreate these classes. -- Dieter