I'm trying to create a simple Rectangle-class in python, but I also need to use points and sizes in my code, so I'm trying to inherit my Rectangle from Point and Size.
The problem is, my Rectangle's initialize method looks awful and I'm not sure if it's even suitable for any code at all.
Here's what I got:
class Size:
    def __init__(self, width=0, height=0):
        self.width = width
        self.height = height
class Point:
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y
class Rectangle(Size, Point):
    def __init__(self, size=None, position=None): #I'd rather not use 4 variables
        if size:
            super(Size, self).__init__(size.width, size.height)
        else:
            super(Size, self).__init__()
        if position:
            super(Point, self).__init__(position.x, position.y)
        else:
            super(Point, self).__init__()
However, it looks awful and it doesn't even work: TypeError: object.__init__() takes no parameters
Is there a cleaner way to do this?
I could of course just force my rectangle to take size and position (not to make them optional) but I would rather not.
I could also define my Rectangle to have a has-a relationship with Size and Point rather than is-a relationship, but that's not even proper OOP and I'm mostly learning here so I'd rather not do that either.
