[issue11510] Peephole breaks set unpacking

2011-07-11 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-15 Thread R. David Murray

R. David Murray  added the comment:

Raymond, it looks like you committed this fix separately to the 3.2 branch and 
the default branch, instead of committing to 3.2 and then merging to default.  
With svn, this wasn't a big deal, but with mercurial it will leave the 3.2 
changeset unmerged, and the next person who wants to submit something will have 
to merge it.  (A dummy merge, since you already committed the fix to default).

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Eugene, thanks for noticing and reporting this.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset db6997fb4c99 by Raymond Hettinger in branch 'default':
Issue 11510: Fix BUILD_SET optimizer bug.
http://hg.python.org/cpython/rev/db6997fb4c99

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 912eb87946e0 by Raymond Hettinger in branch '3.2':
Issue 11510: Fix BUILD_SET optimizer bug.
http://hg.python.org/cpython/rev/912eb87946e0

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

See attached.

--
keywords: +patch
Added file: http://bugs.python.org/file21208/peep.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

It looks like the steps for UNPACK_SEQUENCE should be skipped when following a 
BUILD_SET.  I'll post a patch tomorrow (probably a one-liner).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +dmalcolm, pitrou, rhettinger
priority: normal -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-14 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

Looks like changeset ed8b0ee1c531 (svn r77543) broke it.

--
nosy: +santa4nt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-14 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11510] Peephole breaks set unpacking

2011-03-14 Thread Eugene Toder

New submission from Eugene Toder :

Since the time 'x in set' optimization was added to peephole it has the 
following bug with set unpacking:

>>> def foo(x,y):
a,b = {x,y}
return a,b

>>> dis(foo)
  2   0 LOAD_FAST0 (x) 
  3 LOAD_FAST1 (y) 
  6 ROT_TWO  
  7 STORE_FAST   2 (a) 
 10 STORE_FAST   3 (b) 

  3  13 LOAD_FAST2 (a) 
 16 LOAD_FAST3 (b) 
 19 BUILD_TUPLE  2 
 22 RETURN_VALUE 

That is, unpacking of literal set of sizes 2 and 3 is changed to ROT 
instructions. This, however, changes the semantics, as construction of set 
would eliminate duplicates.

The difference can be demonstrated like this:
Python 3.1
>>> foo(1,1)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in foo
ValueError: need more than 1 value to unpack

Python 3.2
>>> foo(1,1)
(1, 1)

--
components: Interpreter Core
messages: 130917
nosy: eltoder
priority: normal
severity: normal
status: open
title: Peephole breaks set unpacking
type: compile error
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com