""" Created just to test the id of OOP for User representation. Kind of heavy on the memory usage side though. """ from typing import List class User: def __init__(self, id: int, name: str, freinds: List[int] = []) -> None: self.id = id self.name = name self.friends = freinds def __eq__(self, other): if isinstance(other, User): return self.id == other.id else: return False def __repr__(self): return f"User({self.id}, '{self.name}')" class SuperUser(User): def __init__(self, id: int, name: str, friends: List[int] = []): super(SuperUser, self).__init__(id, name, friends) self.admin = True