As discussed internally, use state = self.__dict__.copy(), which is also what the Python docs recommend.
Attach a file by drag & drop or click to upload