[Python-checkins] python/nondist/sandbox/pickletools pickletools.py,1.16,1.17

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 26 Jan 2003 08:10:49 -0800


Update of /cvsroot/python/python/nondist/sandbox/pickletools
In directory sc8-pr-cvs1:/tmp/cvs-serv17052

Modified Files:
	pickletools.py 
Log Message:
Added list-extenders.


Index: pickletools.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/pickletools/pickletools.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** pickletools.py	26 Jan 2003 15:54:25 -0000	1.16
--- pickletools.py	26 Jan 2003 16:10:46 -0000	1.17
***************
*** 123,128 ****
          'name',
  
!         # length of argument, in bytes; an int; UP_TO_NEWLINE means variable-
!         # length, ending at the next occurrence of a newline character
          'n',
  
--- 123,128 ----
          'name',
  
!         # length of argument, in bytes; an int; UP_TO_NEWLINE and
!         # TAKEN_FROM_ARGUMENT are negative values for variable-length cases
          'n',
  
***************
*** 143,147 ****
                                         n is UP_TO_NEWLINE or
                                         n is TAKEN_FROM_ARGUMENT)
- 
          self.n = n
  
--- 143,146 ----
***************
*** 940,943 ****
--- 939,968 ----
        doc="Push an empty dict."),
  
+     # Ways to build lists.
+ 
+     I(name='APPEND',
+       code='a',
+       arg=None,
+       stack_before=[pylist, anyobject],
+       stack_after=[pylist],
+       proto=0,
+       doc="""Append an object to a list.
+ 
+       Stack before:  ... alist anobject
+       Stack after:   ... alist+[anobject]
+       """),
+ 
+     I(name='APPENDS',
+       code='e',
+       arg=None,
+       stack_before=[pylist, markobject, stackslice],
+       stack_after=[pylist],
+       proto=0,
+       doc="""Extend a list by a slice of stack objects.
+ 
+       Stack before:  ... alist markobject rest_of_stack
+       Stack after:   ... alist+rest_of_stack
+       """),
+ 
      # Stack manipulation.
  
***************
*** 1111,1125 ****
        """),
  
-     I(name='APPEND',
-       code='a',
-       arg=None,
-       stack_before=[],
-       stack_after=[],
-       proto=0,
-       doc="""XXX One-line description goes here.
- 
-       XXX Doc body goes here.
-       """),
- 
      I(name='BUILD',
        code='b',
--- 1136,1139 ----
***************
*** 1146,1160 ****
      I(name='DICT',
        code='d',
-       arg=None,
-       stack_before=[],
-       stack_after=[],
-       proto=0,
-       doc="""XXX One-line description goes here.
- 
-       XXX Doc body goes here.
-       """),
- 
-     I(name='APPENDS',
-       code='e',
        arg=None,
        stack_before=[],
--- 1160,1163 ----