diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-01-28 00:22:12 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-01-28 00:22:12 (GMT) |
commit | e105478a0cbdf4d705e48456a9819408440c05f2 (patch) | |
tree | 498108b2da703cb94ee3566f3f6a246c38c0b0c4 /Lib | |
parent | 784a3f53a8f78995d4c8ca22f612a68828bc4838 (diff) | |
download | cpython-e105478a0cbdf4d705e48456a9819408440c05f2.zip cpython-e105478a0cbdf4d705e48456a9819408440c05f2.tar.gz cpython-e105478a0cbdf4d705e48456a9819408440c05f2.tar.bz2 |
Added one-line comments to the proto 2 opcodes.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/pickle.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index 27d28eb..2d6710b 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -133,20 +133,20 @@ BINFLOAT = 'G' # push float; arg is 8-byte float encoding TRUE = 'I01\n' # not an opcode; see INT docs in pickletools.py FALSE = 'I00\n' # not an opcode; see INT docs in pickletools.py -# Protocol 2 (not yet implemented) (XXX comments will be added later) - -PROTO = '\x80' -NEWOBJ = '\x81' -EXT1 = '\x82' -EXT2 = '\x83' -EXT4 = '\x84' -TUPLE1 = '\x85' -TUPLE2 = '\x86' -TUPLE3 = '\x87' -NEWTRUE = '\x88' -NEWFALSE = '\x89' -LONG1 = '\x8a' -LONG4 = '\x8b' +# Protocol 2 (not yet implemented). + +PROTO = '\x80' # identify pickle protocol +NEWOBJ = '\x81' # build object by applying cls.__new__ to argtuple +EXT1 = '\x82' # push object from extension registry; 1-byte index +EXT2 = '\x83' # ditto, but 2-byte index +EXT4 = '\x84' # ditto, but 4-byte index +TUPLE1 = '\x85' # build 1-tuple from stack top +TUPLE2 = '\x86' # build 2-tuple from two topmost stack items +TUPLE3 = '\x87' # build 3-tuple from three topmost stack items +NEWTRUE = '\x88' # push True +NEWFALSE = '\x89' # push False +LONG1 = '\x8a' # push long from < 256 bytes +LONG4 = '\x8b' # push really big long __all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)]) |