In answer to this part of your question, how to make this work:

Person.Address
'Sydney'
>>>Person.Address.type
'%String'
>>>Person.Address = 'Canberra'
>>>print Person.Address. Person.Address.type
Canberra %String


try using the __getattr__ method of the class:

class objWithTypeAttr(object):
...     def __getattr__(self,key):
...         if key is not "type":
...             return self.__dict__[key]
...         else:
...             return type(self.val)
...     def __init__(self,val):
...         self.val=val
...
a=objWithTypeAttr("blah")
a
<__main__.objWithTypeAttr object at 0x00AE0CD0>
a.val
'blah'
a.type
<type 'str'>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to