[issue8153] 'set' union() fails in specific use case

Ezio Melotti report at bugs.python.org
Tue Mar 16 08:42:27 CET 2010


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

set.union doesn't change the first set (i.e. a), but returns a new sets (i.e. c):
>>> def func():
...   a = set([0])
...   a.pop()
...   print 'a:', a
...   b = set([1, 2])
...   c = a.union(b)
...   print 'a:', a
...   return c
...
>>> func()
a: set([])
a: set([])
set([1, 2])

----------
nosy: +ezio.melotti
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8153>
_______________________________________


More information about the Python-bugs-list mailing list