[Python-checkins] peps: Add current opcodes, as implemented by Alexandre

antoine.pitrou python-checkins at python.org
Sat Nov 16 19:08:08 CET 2013


http://hg.python.org/peps/rev/a6d05d3fe0cd
changeset:   5274:a6d05d3fe0cd
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sat Nov 16 19:08:03 2013 +0100
summary:
  Add current opcodes, as implemented by Alexandre

files:
  pep-3154.txt |  33 +++++++++++++++++++++++++++++++++
  1 files changed, 33 insertions(+), 0 deletions(-)


diff --git a/pep-3154.txt b/pep-3154.txt
--- a/pep-3154.txt
+++ b/pep-3154.txt
@@ -143,6 +143,39 @@
 would make many pickles smaller.
 
 
+Summary of new opcodes
+======================
+
+* ``SHORT_BINUNICODE``: push a utf8-encoded str object with a one-byte
+  size prefix (therefore less than 256 bytes long).
+
+* ``BINUNICODE8``: push a utf8-encoded str object with a eight-byte
+  size prefix (for strings longer than 2**32 bytes, which therefore cannot
+  be serialized using ``BINUNICODE``).
+
+* ``BINBYTES8``: push a bytes object with a eight-byte size prefix
+  (for bytes objects longer than 2**32 bytes, which therefore cannot be
+  serialized using ``BINBYTES``).
+
+* ``EMPTY_SET``: push a new empty set object on the stack.
+
+* ``ADDITEMS``: add the topmost stack items to the set (to be used with
+  ``EMPTY_SET``).
+
+* ``EMPTY_FROZENSET``: push a new empty frozenset object on the stack.
+
+* ``FROZENSET``: create a frozenset object from the topmost stack items,
+  and push it on the stack.
+
+* ``NEWOBJ_EX``: take the three topmost stack items ``cls``, ``args``
+  and ``kwargs``, and push the result of calling
+  ``cls.__new__(*args, **kwargs)``.
+
+* ``STACK_GLOBAL``: take the two topmost stack items ``module_name`` and
+  ``qualname``, and push the result of looking up the dotted ``qualname``
+  in the module named ``module_name``.
+
+
 Alternative ideas
 =================
 

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list