[Python-checkins] python/dist/src/Lib pickle.py,1.67,1.68

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
2002年7月16日 12:47:45 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv20531/Lib
Modified Files:
	pickle.py 
Log Message:
Given the persistent id code a shot at a class before calling save_global().
Some persistent picklers (well, probably, the *only* persistent
pickler) would like to pickle some classes in a special way.
Index: pickle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** pickle.py	30 Jun 2002 03:39:14 -0000	1.67
--- pickle.py	16 Jul 2002 19:47:43 -0000	1.68
***************
*** 214,217 ****
--- 214,222 ----
 f = self.dispatch[t]
 except KeyError:
+ pid = self.inst_persistent_id(object)
+ if pid is not None:
+ self.save_pers(pid)
+ return
+ 
 try:
 issc = issubclass(t, TypeType)
***************
*** 220,228 ****
 if issc:
 self.save_global(object)
- return
- 
- pid = self.inst_persistent_id(object)
- if pid is not None:
- self.save_pers(pid)
 return
 
--- 225,228 ----

AltStyle によって変換されたページ (->オリジナル) /