I am trying to use OO on python to create a nice structured class. I have an object that all functions from one class will inherit but there are sub functions (getter and setter) that may require one or two additional parameters.
How can I get this type of logic to work correctly.
class XYZ(object):
def __init__(self, cameraId):
self.cameraId = cameraId;
self.index = "";
def get_test(self):
print "Index: " + self.index + " CameraID: " + self.cameraId;
return self.cameraId;
def set_test(self, value, myValue=""):
self.cameraId = value;
self.index = myValue;
return True;
TEST_XYZ = property(get_test,set_test);
You can use
tuple-typed values. Note that you don’t have to use;after your statements…