All Questions
2 questions
-1
votes
1
answer
886
views
Why is `replace(dataclass, **kwargs)` a function, and not a member?
Imagine a simple data class:
@dataclass
class Settings:
m: int
s: str
old = Settings(m=10, s="ten")
It feels normal to write new = old.replace(m=1), but we have to write new = replace(...
2
votes
2
answers
624
views
Implementing interfaces vs using a base class
I am writing an application in python. The part I am little confused about is providing a little structure to my code.
This is the basic requirement of my web application.
I have these different ...