I come from Java, and I want to do some data transfer objects (DTOs) like this:
class ErrorDefinition():
code = ''
message = ''
exception = ''
class ResponseDTO():
sucess = True
errors = list() # How do I say it that it is directly of the ErrorDefinition() type, to not import it every time that I'm going to append an error definition?
Or is there a better way to do this?
I am not sure what you are trying to say in this comment, but if I understand right, the best way to get something close is to define a method to add an error.