[Python-checkins] python/dist/src/Lib pickle.py,1.118,1.119

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Tue, 28 Jan 2003 14:31:29 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5335

Modified Files:
	pickle.py 
Log Message:
Add a comment about how some built-in types should grow a
__getnewargs__ method.


Index: pickle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -d -r1.118 -r1.119
*** pickle.py	28 Jan 2003 22:29:13 -0000	1.118
--- pickle.py	28 Jan 2003 22:31:25 -0000	1.119
***************
*** 369,373 ****
      def save_newobj(self, obj):
          # Save a new-style class instance, using protocol 2.
!         # XXX Much of this is still experimental.
          assert self.proto >= 2          # This only works for protocol 2
          t = type(obj)
--- 369,373 ----
      def save_newobj(self, obj):
          # Save a new-style class instance, using protocol 2.
!         # XXX This is still experimental.
          assert self.proto >= 2          # This only works for protocol 2
          t = type(obj)
***************
*** 376,379 ****
--- 376,381 ----
              args = getnewargs()         # This bette not reference obj
          else:
+             # XXX These types should each grow a __getnewargs__
+             # implementation so this special-casing is unnecessary.
              for cls in int, long, float, complex, str, UnicodeType, tuple:
                  if cls and isinstance(obj, cls):