Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import pickle
  2. class F:
  3. def __init__(self,fileName):
  4. self = pickle.load(fileName)
  5. # let self.fileName be equal to fileName in this example.
  6. def __del__(self):
  7. pickle.dump(self.fileName, self)
  8. def miscMutatingMethod(self):
  9. ...
  10.  
  11. class F(autopickle):
  12. def __init__(self,filename):
  13. autopickleFilename = filename
  14. #now autopickle can do its work.
  15. def miscMutatingMethod(self):
  16. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement