You can look at this,and type is a reserved word in python.
class Object_refs(object):
def __init__(self, descriptor_type, my_type, reference_count, flags=None):
'''initializer method can be compared with constructor C++,but are not the same'''
self.desctype = descriptor_type
self.my_type = my_type
self.refcount = reference_count
self.flags = flags
Use class.
>>> descriptor_type = 1
>>> my_type = 'string'
>>> reference_count = 10
>>> obj = Object_refs(descriptor_type,my_type,reference_count)
>>> obj.my_type
'string'
>>> obj.my_type = '\u01'
>>> obj.my_type
'\\u01'
>>>
snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294