[issue8425] a -= b should be fast if a is a small set and b is a large set

Michele Orrù report at bugs.python.org
Mon Sep 24 19:02:39 CEST 2012


Michele Orrù added the comment:

What do you mean by "does not preserve set identity"? Because I see: 

$ ./python.exe
Python 3.3.0rc2+ (default:178f9042af81+, Sep 24 2012, 18:54:31) 
[GCC 4.2.1 Compatible Apple Clang 2.1 (tags/Apple/clang-163.7.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = set(range(1))
[65967 refs]
>>> b = set(range(20))
[65989 refs]
>>> id(a)
4540421032
[65992 refs]
>>> a -= b
[65991 refs]
>>> id(a)
4540421032

----------

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


More information about the Python-bugs-list mailing list