Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- class F:
- def __init__(self,fileName):
- self = pickle.load(fileName)
- # let self.fileName be equal to fileName in this example.
- def __del__(self):
- pickle.dump(self.fileName, self)
- def miscMutatingMethod(self):
- ...
- class F(autopickle):
- def __init__(self,filename):
- autopickleFilename = filename
- #now autopickle can do its work.
- def miscMutatingMethod(self):
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement