You are describing pickle, but it does come with some serious risks, especially if the file can be modified by a third party.
https://arjancodes.com/blog/python-pickle-module-security-risks-and-safer-alternatives/
I'd suggest using protobuf or similar instead, but its a bit more work.
Anyone had to deal with mud daubers or paper wasps? I have both creating a nest on my house.
Everything I've read suggests they are nonviolent, so my current plan was to leave them be, and then knock off the nests next winter. Its gonna be a zero tolerance policy, if I get bitten once, both are gone.
Am I gonna regret it?