On 25 May 2013 19:38, Steven D'Aprano <st...@pearwood.info> wrote: > On 26/05/13 05:23, Mark Lawrence wrote: >
> On the right hand side, 5,8 creates a tuple, which is then immediately > unpacked to two individual values. You can see this by disassembling the > code. In 2.7, you get this: > > py> from dis import dis > py> code = compile("a, b = 5, 8", "", "exec") > py> dis(code) > 1 0 LOAD_CONST 3 ((5, 8)) > 3 UNPACK_SEQUENCE 2 > 6 STORE_NAME 0 (a) > 9 STORE_NAME 1 (b) > 12 LOAD_CONST 2 (None) > 15 RETURN_VALUE > > That disassembling looks like it could clarify a number of things. I'll have to try it. It might make more sense to me since my only programming, besides a bit of javascript copy-hacking for websites, was A86 Assembler, some decades ago, when I wrote an ASCII Art prog for Fidonet. Then I got into other fields entirely to make a living. But Asm actually makes sense to me and the disassemble looks close to it. (I can't count the times I wiped out DOS and had to reload it ;') A86 had a wonderful macro language, though. Jim
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor