Message55502
Guido van Rossum schrieb:
> Guido van Rossum added the comment:
>
> On 8/30/07, Thomas Wouters <report@bugs.python.org> wrote:
>>
>> Thomas Wouters added the comment:
>>
>> Here's a working version of that idea, with a WeakSet implementation I
>> had lying around (but never really used.) It seems to work, and fixes
>> the refcount issues, but the WeakSet could do with some extra tests ;-)
>
> I was torturing the WeakSet implementation, but didn't get very far:
>
> Python 3.0x (py3k, Aug 30 2007, 09:27:35)
> [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from weakref import WeakSet as WS
> [40407 refs]
>>>> a = WS([1, 2, 3])
> Fatal Python error: Cannot recover from stack overflow.
> Aborted
The update() method can not be implemented in terms of converting the
argument to a WeakSet, since that leads to infinite recursion on creation
(as to why you get this fatal error, not a RuntimeError, no idea).
Also, the fact that the operator-versions of set operations only support
other sets as their second operands, while the method-versions support any
iterable, is not preserved.
Georg |
|
Date |
User |
Action |
Args |
2007-08-30 19:02:39 | georg.brandl | set | spambayes_score: 0.116548 -> 0.11654798 recipients:
+ georg.brandl, gvanrossum, twouters |
2007-08-30 19:02:39 | georg.brandl | link | issue1061 messages |
2007-08-30 19:02:39 | georg.brandl | create | |
|