[Patches] [Patch #101146] Replace UNPACK_TUPLE and UNPACK_LIST with UNPACK_SEQUENCE

noreply@sourceforge.net noreply@sourceforge.net
Fri, 11 Aug 2000 14:57:30 -0700


Patch #101146 has been updated. 

Project: 
Category: core (C code)
Status: Accepted
Summary: Replace UNPACK_TUPLE and UNPACK_LIST with UNPACK_SEQUENCE

Follow-Ups:

Date: 2000-Aug-10 13:59
By: twouters

Comment:
Remove the UNPACK_TUPLE and UNPACK_LIST opcodes in favor of a single UNPACK_SEQUENCE opcode, since both the implementation and the generation of the UNPACK opcodes are identical.

-------------------------------------------------------

Date: 2000-Aug-11 02:51
By: nowonder

Comment:
Looks fine on visual inspection and works for me, too.

Someone else should review this, too.
-------------------------------------------------------

Date: 2000-Aug-11 12:13
By: tim_one

Comment:
Assigned to Guido for Final Pronouncement: looks fine to me too.  Implications:
1. You're not going to want to reintroduce a distinction between unpacking tuples and lists someday.
2. The 2.0 PVM has no chance of running .pyc/.pyo from earlier versions.

-------------------------------------------------------

Date: 2000-Aug-11 12:14
By: tim_one

Comment:
Assigned to Guido for Final Pronouncement: looks fine to me too.  Implications:
1. You're not going to want to reintroduce a distinction between unpacking tuples and lists someday.
2. The 2.0 PVM has no chance of running .pyc/.pyo from earlier versions.

-------------------------------------------------------

Date: 2000-Aug-11 13:42
By: gvanrossum

Comment:
Agree with #1 from Tim.
Disagree with #2: this would be the first place where 1.6 and 2.0 differ in the bytecode. Suggestion to fix: keep opcode 93 assigned to UNPACK_LIST and keep the case for it in the switch.
-------------------------------------------------------

Date: 2000-Aug-11 14:44
By: twouters

Comment:
I'm not sure how to interpret this bytecode compatibility argument. The current CVS tree already has a different bytecode magic than has Python 1.5.2, so the normal interpreter refuses to load the old bytecode. I was forced to download the source to pysol ever since installing the CVS tree, several months ago :-) Is there some way to determine (& use) different-but-compatible bytecodes I missed ?

When (and how) is a clean break initiated, then ? A number of other proposed patches (augmented assignment, range literals, 'import as') also change bytecode, and 'import as' might need to remove (or change) a current bytecode as well.

I'll upload a version that re-adds UNPACK_LIST (as DEPRECATED_UNPACK_LIST perhaps ?) to the switch later. Or if the patch is otherwise accepted, I'd prefer not to upload it, instead just check it in -- saves me a lot of work :-)
-------------------------------------------------------

Date: 2000-Aug-11 14:57
By: gvanrossum

Comment:
OK, I forgot all the other new bytecodes.  Never mind. Check it in!
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101146&group_id=5470