[Python-checkins] python/nondist/sandbox/pickletools pickletools.py,1.21,1.22

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sun, 26 Jan 2003 10:17:09 -0800


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

Modified Files:
	pickletools.py 
Log Message:
Added SETITEM and SETITEMS.


Index: pickletools.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/pickletools/pickletools.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** pickletools.py	26 Jan 2003 18:06:00 -0000	1.21
--- pickletools.py	26 Jan 2003 18:17:06 -0000	1.22
***************
*** 1019,1022 ****
--- 1019,1057 ----
        """),
  
+     I(name='SETITEM',
+       code='s',
+       arg=None,
+       stack_before=[pydict, anyobject, anyobject],
+       stack_after=[pydict],
+       proto=0,
+       doc="""Add a key+value pair to an existing dict.
+ 
+       Stack before:  ... pydict key value
+       Stack after:   ... pydict
+ 
+       where pydict has been modified via pydict[key] = value.
+       """),
+ 
+     I(name='SETITEMS',
+       code='u',
+       arg=None,
+       stack_before=[pydict, markobject, stackslice],
+       stack_after=[pydict],
+       proto=1,
+       doc="""Add an arbitrary number of key+value pairs to an existing dict.
+ 
+       The slice of the stack following the topmost markobject is taken as
+       an alternating sequence of keys and values, added to the dict
+       immediately under the topmost markobject.  Everything at and after the
+       topmost markobject is popped, leaving the mutated dict at the top
+       of the stack.
+ 
+       Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
+       Stack after:   ... pydict
+ 
+       where pydict has been modified via pydict[key_i] = value_i for i in
+       1, 2, ..., n, and in that order.
+       """),
+ 
      # Stack manipulation.
  
***************
*** 1225,1250 ****
      I(name='OBJ',
        code='o',
-       arg=None,
-       stack_before=[],
-       stack_after=[],
-       proto=0,
-       doc="""XXX One-line description goes here.
- 
-       XXX Doc body goes here.
-       """),
- 
-     I(name='SETITEM',
-       code='s',
-       arg=None,
-       stack_before=[],
-       stack_after=[],
-       proto=0,
-       doc="""XXX One-line description goes here.
- 
-       XXX Doc body goes here.
-       """),
- 
-     I(name='SETITEMS',
-       code='u',
        arg=None,
        stack_before=[],
--- 1260,1263 ----