[issue2292] Missing *-unpacking generalizations
Alexander Belopolsky
report at bugs.python.org
Mon Apr 7 21:53:35 CEST 2008
Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:
On Mon, Apr 7, 2008 at 3:07 PM, Guido van Rossum <report at bugs.python.org> wrote:
> Can you show an example where this would be different?
Admittedly a contrived example, but
... def __hash__(self):
... print('hash', self)
... return int.__hash__(self)
...
>>> a,b,c = map(X, range(3))
>>> {a,b,c}
hash 2
hash 1
hash 0
{0, 1, 2}
>>> {a,*(b,c)}
hash 0
hash 1
hash 2
{0, 1, 2}
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2292>
__________________________________
More information about the Python-bugs-list
mailing list