Author quiver
Recipients
Date 2004-10-16.23:05:54
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
If I run the following script, it causes a SystemError.
# start of program
from collections import deque

d1 = deque()
d2 = deque()

class A:
    def __eq__(self, other):
        d1.pop()
        d1.appendleft(1)
        return 1

d1.extend((0, 1))
d2.extend((A(), 1))

d1 == d2
# end of program

$ python2.4 deque_demo.py
Traceback (most recent call last):
  File "deque_demo.py", line 15, in ?
    d1 == d2
SystemError: error return without exception set

This error happens if
- __eq__ returns values that are interpreted as True.
- appendleft is used insted of append.

Tested on Python 2.4a3(Win) and python2.4 from CVS 
as of 2004/10/15.

I attached this program for convenience.
History
Date User Action Args
2007-08-23 14:26:44adminlinkissue1048498 messages
2007-08-23 14:26:44admincreate