Re: [Pyobjc-dev] Key/Value Coding
Brought to you by:
ronaldoussoren
From: Pierce T. W. I. <pi...@tw...> - 2003-08-14 19:40:14
|
On Thursday, August 14, 2003, at 11:52 AM, Ronald Oussoren wrote: > > On Thursday, 14 August, 2003, at 18:38, Pierce T. Wetter III wrote: > >> >> On Tuesday, August 12, 2003, at 09:41 PM, b.bum wrote: >> >>> I committed a new Key/Value coding unit test and a bit of additional >>> functionality in the KeyValueCoding module within PyObjCTools. It >>> includes a compiled module. >>> >>> The unit tests do not pass and are currently, more or less, a >>> feature request. >>> >>> The goal is to make PyObjC's key/value coding support compliant with >>> ObjC to the point where Python, ObjC or mixed PyObjC instances can >>> be transparently passed into K/V dependent functionality. We need >>> this to fully support the increasing emphasis on Key/Value Coding >>> found within Mac OS X. >> >> As a WO hacker, I love KVC, so having KVC support would be cool and >> possibly should be a python feature separate from pyobjc. I forsee >> some problems on the Python side because python doesn't have separate >> name spaces based on type. > > We already support KVC, NSKeyValueCoding protocol works from > Objective-C (both for plain python objects and hybrid objects) and > PyObjCTools.KeyValueCoding can be used to do KVC from Python in a more > Python-friendly way. > > As you noted, we cannot use exactly the same conventions for Python as > are used in Objective-C. The KVC support for python objects uses > 'getKey' and 'get_key' as the getter method for 'key' and 'setKey' and > 'set_key' as the setter method for 'key'. > I'm going to roll back Bill's patch, it's not very usefull just before > a 1.0 release. I'm going to look at the unittest to check if they add > tests that should be added to the other KVC unittest files. Actually, its a trivial change to get "key" to work as well. I sent changes independently to bill that fix most of the broken unit tests, except the ones where python is subclassing. In that case, the objects aren't getting built for some reason, so I'll have to pass on those. Pierce |