Re: [Pyobjc-dev] pickled Objective-C objects
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-02-24 09:48:31
|
Ronald Oussoren wrote: > > __init__/tp_init method. Calling an ObjC class will then still > > result in that exception, while still properly supporting __new__. > > > Class clusters may be problematic here (in combination with pickling). > If you create an NSArray you actually end up with a subclass of > NSArray. This should be pickled as if it is an NSArray (Apple might > replace the classes implementing NSArray by a completely different set > of classes). Yes, it abviously need to support classForCoder. But I would expect that NSArray.alloc().initWithCoder() is the right thing, no? If so, aliasing __new__ to alloc() is quite natural. > BTW. I just tried to pickle some Cocoa objects using protocol version > 2, and that didn't crash. It also didn't work correctly (of course): > the Objective-C state isn't saved. I noticed that too ;-) Just |