Issue1048498
Created on 2004-10-16 23:05 by quiver, last changed 2004-10-18 03:32 by rhettinger.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
deque_demo.py
|
quiver,
2004-10-16 23:05
|
|
|
|
| msg22711 (view) |
Author: George Yoshida (quiver) |
Date: 2004-10-16 23:05 |
|
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.
|
| msg22712 (view) |
Author: Raymond Hettinger (rhettinger) |
Date: 2004-10-17 01:03 |
|
Logged In: YES
user_id=80475
I think that has been fixed. Please reverify with Py2.4b1
when it comes out.
|
| msg22713 (view) |
Author: George Yoshida (quiver) |
Date: 2004-10-18 01:40 |
|
Logged In: YES
user_id=671362
I've verified that recent Python raises "RuntimeError :
deque mutated during iteration" against my program.
Thanks Raymond.
Before submitting this, I tested on Cygwin and it looks like
my Cygwin had a problem with libinstall.
That is why not all the libraries were installed properly in
the process of "make install".
Sorry about that.
|
| msg22714 (view) |
Author: Raymond Hettinger (rhettinger) |
Date: 2004-10-18 03:32 |
|
Logged In: YES
user_id=80475
I appreciate the efforts to break the new tools and review
all the docs. Keep up the good work.
|
|
| Date |
User |
Action |
Args |
| 2004-10-16 23:05:54 | quiver | create | |
|