I'd like to know if dataclasses have some way of adding a **kwargs
to the auto generated __init__. I know I can write my own init method and add it myself, but it's a pain to have to rewrite all the fields, which is one of the main reasons for using dataclasses.
My use case: if I make a request to an API that returns JSON, I like to dump the response into a dataclass. It adds some type safety and makes it easy to do any transforming to the response, like converting timestamps into datetime objects.
However, there are often times where I only care about a subset of the fields that are returned. If I don't include the fields in the dataclass and try to instantiate it, it will complain about unexpected keyword arguments.
The most straightforward solution is just writing a custom init func but I'm curious if there's a way to capture the extra fields as kwargs without doing it by hand.