I have defined some classes thusly:
class CustomParameter():
def __init__(self, strFriendlyAttribName, strSystemAttribName):
self.FriendlyAttribName = strFriendlyAttribName
self.SystemAttribName = strSystemAttribName
class PartMaster():
AttribNameList = ["Part Number", "Name", "Standard Part", "Part Type", "ControlledBy", "PIN", "Design Responsibility"]
def __init__(self):
self._UUID = None
self.PartNumber = CustomParameter("Part Number", "V_ID"),
self.Name = CustomParameter("Name", "V_name"),
self.StandardPart = CustomParameter("Standard Part", "V508_isStandardPart"),
self.PartType = CustomParameter("Part Type", "V511_PartType"),
self.ControlledBy = CustomParameter("ControlledBy", "V511_ControlledBy"),
self.PIN = CustomParameter("PIN", "BOECACPinItemNumber"),
self.DesignResponsibility = CustomParameter("Design Responsibility", "BOECACDesignRpnse")
class Part():
def __init__(self, PartNumber):
self.PartNumber = PartNumber
#This instance wraps
self.PartMaster = PartMaster() #create new instance
test = Part("ABC")
I would expect that test.PartMaster.PIN
would be an instance of CustomParameter, but instead it is a tuple tuple: (<__main__.CustomParameter instance at 0x0000000002D724C8>,)
Why is this, and how can I make it not be so?
I'd like to construct my classes such that test.PartMaster.PIN
gives me back the instance instance of my CustomParameter class. Any ideas?