class AutoID: last_id = 0 def __init__(self): self.increment_id() self.id = self.last_id @classmethod def increment_id(cls): cls.last_id += 1 @classmethod def reset_id(cls): cls.last_id = 0