python class advanced