I have a class called Image
class Image(object):
def __init__(self,rgb_img):
self.img_time = time.time()
self.img_colr = rgb_img
I want to store some more information on this class at a later time (image keypoints, grey scale, etc.) and believe it is more clear to make a new class altogether. But I don't know the best practice for this. Heres my guess:
img = Image(rgb_img)
class DetailedImage(object):
def __init__(self, img, kp, grey):
self = img
self.kp = kp
self.grey = grey
Still, this option is implicit. It is not immediately obvious that the img argument must be an Image instance.
What is the best practice for creating a new class using an instance from another class? (i.e. if I have a peasant, and he trains to become a warrior, how to I pass information from the instantiated peasant class to a separate warrior class?) Is this even a good idea to do?