A dataclass is just a class where all it does is fill internal attributes (lots of self.x = "foo"). To fill a dataclass from kwargs, instead of:
def __init__(self, x=None, y=None):
self.x = x
self.y = y
You can do: def __init__(self, **kwargs):
self.__dict__.update(kwargs) # This may be **kwargs, I'm fuzzy on it
With this, the following code works with both: myObj = MyClass(x=1, y=2)
Now, you might say "but with the kwargs method you can add _ANY_ attribute not just x and y!"That's precisely the point. When you're still iterating on the ergonomics, you want the ability to add new things without repeating a bunch of boilerplate. Once you've figured out what those look like, you can and should go back and fix the names in stone.