[ZPT] nested access to object data
Jamie Heilman
jamie at audible.transient.net
Thu May 8 03:47:03 EDT 2003
Andreas Jung wrote:
> But I want "here/getFoo/key" :-)
from ComputedAttribute import ComputedAttribute
class X:
_data1 = {}
_data2 = {}
def _getData1(self): return self._data1.copy()
def _getData2(self): return self._data2.copy()
data1 = ComputedAttribute(_getData1)
data2 = ComputedAttribute(_getData2)
Appears to work for me, you'll have to play with it more to see if it
does everything you want.
--
Jamie Heilman http://audible.transient.net/~jamie/
"...thats the metaphorical equivalent of flopping your wedding tackle
into a lion's mouth and flicking his lovespuds with a wet towel, pure
insanity..." -Rimmer
More information about the ZPT
mailing list