Re: [Pyobjc-dev] Key/Value Coding
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-08-15 05:59:07
|
On Thursday, 14 August, 2003, at 22:40, Pierce T. Wetter III wrote: >>> >> >> It may be trivial to get this to work, but not necessarily correct. >> In python the accessor methods are named 'get_value' and 'set_value' >> (or the camelcase variations of those), using accessors named like an >> attribute would be confusing. > > Actually, I think you misunderstand the problem. KeyValueCoding as > checked in won't let you do: > > object.accessor.accessor > > because it needs to do: > > object.accesssor().accessor() in python, and its assuming accessor > is a plain attribute, so it reutrns object.accessor the function > pointer. So you can walk chains of plain attributes, but you can't > walk any that have accessors involved, unless they have a "get" or > "get_" method. Since there's no "getLen()" or "getCapitalize()" on > string, or 99% of the methods of the other system classes, KVC has to > get the results of m=getattr, and if it is callable, > return m(). <img src="lightbulb"> Aha, I, finally ;-), start to understand what the fuzz is all about. You want to be able to call normal argumentless methods using KVC. That might be usefull, I'll update the code to allow this. Ronald |