data transfer object in python

main.py
# Creating a Data Transfer Object (DTO)
class DTO:
    def __init__(self, data1, data2):
        self.data1 = data1
        self.data2 = data2

# Example of using the DTO
dto_obj = DTO("value1", "value2")

# Accessing the data in the DTO object
print(dto_obj.data1)
print(dto_obj.data2)
287 chars
13 lines

gistlibby LogSnag