[Pyobjc-dev] NSCoding support for python list & dict
Brought to you by:
ronaldoussoren
|
From: Barry W. <bar...@gm...> - 2007-11-26 20:35:15
|
PyObjC2 now raises an exception if one tries to encode a python list or dict instance using an NSCoder. I agree that this behavior is preferable to letting the action proceed silently. I'm wondering why PyObjC doesn't encode a list as if it were an NSMutableArray and a dict as if it were an NSMutableDictionary, however. One of our apps does a lot encoding of dictionaries created in python plugins. Converting these dicts to NSDictionaries via NSDictionary.dictionaryFromDictionary_ is fine, but seems to be a glaring special case of the otherwise seemless bridge. If I can treat python dicts as NSMutableDictionaries on the Objective-C side, why can't I encode them as such? Scanning the NEWS file, I see that this is mentioned, but I haven't found the rationale. Please understand I'm not trying to disparage the amazing work that the PyObjC devs have done on PyObjC2. I'm just posing the question to either understand the technical reason(s) behind the decision or raise some discussion on other options. Thanks, Barry |