Re: [Pyobjc-dev] pickled Objective-C objects
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-02-24 18:37:11
|
On Monday, Feb 24, 2003, at 13:29 US/Eastern, Just van Rossum wrote: > Is objc._convenience the right place for this? I guess not since it > currently doesn't even import Foundation. Maybe, maybe not. Likely, the correct approach would be to test the object to see if it responds to the NSCoding protocol. If it does, then NSArchiver/NSUnarchiver can be used to archive/unarchive instances of the class and, hence, the class is pickle compatible. > PS: It seems NSData doesn't support the buffer protocol; you can't pass > a string where an NSData is expected, and str(anNSDataInstance) doesn't > do the right thing. Can the buffer protocol be implemented entirely on the Python side of the bridge? Is so, it should be easy to support? If not, then the ObjC->Python proxy would have to be extended to offer buffer protocol features *only* if appropriate. Given the way this is implemented, I believe the implication is that we would need to effectively create a second proxy class [python C-API type class] that contains non-NULL entries for the buffer protocol support? b.bum |