Use inherited class method within __init__
问题 I have a parent class that is inherited by several children. I would like to initialize one of the children using the parent's @classmethod initializers. How can I do this? I tried: class Point(object): def __init__(self,x,y): self.x = x self.y = y @classmethod def from_mag_angle(cls,mag,angle): x = mag*cos(angle) y = mag*sin(angle) return cls(x=x,y=y) class PointOnUnitCircle(Point): def __init__(self,angle): Point.from_mag_angle(mag=1,angle=angle) p1 = Point(1,2) p2 = Point.from_mag_angle(2