There's another really simple and elegant approach that can be applied here which is to just subclass 'dict' since it is serializable by default.
from json import dumps
class Response(dict):
def __init__(self, status_code, body):
super().__init__(
status_code = status_code,
body = body
)
r = Response()
dumps(r)