[Zope] handling exceptions for external methods

Dieter Maurer dieter at handshake.de
Sun Jul 8 04:43:03 EDT 2007


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


More information about the Zope mailing list