Re: [Pyobjc-dev] Documentation for objc.kvo_property
Brought to you by:
ronaldoussoren
From: Ronald O. <ron...@ma...> - 2009-09-01 08:34:22
|
On 1 Sep, 2009, at 10:20, James R Eagan wrote: > Hi Ronald, > > I've taken a quick scan of the document and made some comments > inline, prefixed with "JRE:" at the beginning of a paragraph. > (Also, in case it ends up evolving into official documentation, I've > corrected a couple of spelling mistakes, too (grep for "(sp)").) > > Overall, I really like the idea. I've only suggested a couple of > minor tweaks and nits. > > Also, does "kvo_property" make the most sense as a name, since it > seems to me the KVO-compatibility, while the primary impetus for > this feature, is actually a side-effect. Really we're just talking > about objc properties. But obj.property won't work for obvious > reasons, and I like objc.objc_property even less. objc.property would work, but could be confusing (especially when people do 'from objc import *'). W.r.t. your comments in the document: * name is the first argument to kvo_property to be consistent with the definition of objc.ivar. I'll update the document to mention that the intended use is to always use keyword arguments, although that might not be enforceable. * I'm not to happy about the 'rw' argument myself, but like the open- style mode string even less. I might change this to a readonly argument, defaulting to False, because that way we stay closer to the objc interface: @property(readonly) foo; * I like the 'mutableCopy' variation, although I'll have to think about a proper interface for this. This won't add too much complexity to the implementation, I'll have to implement the setter method anyway. * I don't understand you question about dynamicly detecting the defining class. BTW. I'm not 100% sure that the set of decorator attributes is complete, I'm pretty sure that I came up with an additional one after writing the document but cannot remember that now :-( Ronald > > Please take everything with a grain of salt. :-) > > Cheers, > James > > <25properties-jre.txt> > > Le 1 sept. 2009 à 08:36, Ronald Oussoren a écrit : > >> Hi, >> >> A while back I mentioned that it should be possible to add code to >> PyObjC to make working with KVO properties easier. In the long run >> this should enable using all Objective-C properties using regular >> attribute access rather than using getter/setter methods. >> >> I've attached a document that describes the interface for this and >> I'm interested to know if the interface is sane and usable. I don't >> know when I'll get around to actually implement this though, and >> the interface might need to be changed when I actually start >> working on the implementation and testcases. >> >> Ronald >> >> >> < >> 25properties >> .txt >> > >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports >> 2008 30-Day >> trial. Simplify your report design, integration and deployment - >> and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |