Dataclass, just to save time for a cup of coffee
The common way to define a class
When trying to encapsulate a class in python, we use __init__ to carry out parametric construction. Just like below:
class Message:
def __init__(self, mid:int, text:str) -> None:
self.__id: int = mid
...
warrenh.hashnode.dev2 min read