I thought about it, but it would make the XML file depend on the machine... no more portability...
On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Franck PEREZ <[EMAIL PROTECTED]> writes: > > ########### My test application ############ > > class Foo(object): > > #The class I'd like to serialize > > pass > > > > import myMarshaller > > foo = Foo() > > s = myMarshaller.dumps(foo) #works fine, spits something like <object > > class = "Foo"...> > > another_foo = loads(s) #fails, see below > > > > ########### My marshaller (in its own module) ############ > > def loads(s): > > #First, get class name (here "Foo") > > klass = eval(className) #fails because "Foo" is not in the > > marshaller's namespace ! > > > > How could I tell the marshaller to locate the Foo class and any other > > class I try to deserialize ? > > How about adding Foo.__file__ to the serialized data? > > <mike > -- > Mike Meyer <[EMAIL PROTECTED]> > http://www.mired.org/home/mwm/ > Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list