On Fri, Jan 30, 2009 at 9:43 AM, Edward K. Ream <[email protected]> wrote:

>
>
> It doesn't work to just have p.v.u return the dict (having created it
>> if required)?
>
>
Yes.  You *are* right. This does work::

def __get_u(self):
    v = self
    if not hasattr(v,'unknownAttributes'):
        v.unknownAttributes = {}
    return v.unknownAttributes

Here's proof:

print p.v.u
print p.v.u.get('key')
p.v.u['key'] = 'abc'
print p.v.u.get('key')

Yields, for example,

{u'key': 'abc'}
abc
abc

Furthermore, a setter could be defined.

Thanks for un-confusing me.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to