Re: [Pyobjc-dev] NSCoding support for python list & dict
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2007-11-27 05:59:39
|
On 26 Nov, 2007, at 21:35, Barry Wark wrote: > 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. Good point. I'd like to add full NSCoding support for all python objects (or at least all pickle-able objects) in the future, but supporting just lists/tuples/dicts should be easy enough to do. NSCoding support for other objects should also be doable, but is more work and requires a lot of testing. Pickling Objective-C objects on the other hand has the outlooks of being a very hard problem. Anyhow, the most likely reason for missing features like this is me not having time to work on them. Knowing which features are helpfull for real applications, rather than just looking nice on a list of features, helps prioritizing development. So, thanks for the feedback. Ronald > > > Thanks, > Barry > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |