Issue1612
Created on 2007-12-13 15:41 by mark, last changed 2007-12-13 17:31 by gvanrossum.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
bug.py
|
mark,
2007-12-13 15:41
|
|
|
|
|
msg58536 - (view) |
Author: Mark Summerfield (mark) |
Date: 2007-12-13 15:41 |
|
In the attached file there are two tiny functions, flatten1() and
flatten2(). There is only one difference between them:
flatten1() has the line:
if isinstance(x, list):
and flatten2() has this line instead:
if isinstance(x, collections.Sequence):
flatten1() works perfectly in Python 2.5.1 and Python 30a2 (just comment
out the flatten2() code).
But flatten2() goes into "infinite" recursion in Python 30a2 when trying
to flatten list "c".
|
|
msg58537 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-12-13 17:31 |
|
The bug is in your code; a string is considered a sequence but its
elements are also strings (of length 1).
|
|
| Date |
User |
Action |
Args |
| 2007-12-13 17:31:03 | gvanrossum | set | status: open -> closed resolution: invalid messages:
+ msg58537 nosy:
+ gvanrossum |
| 2007-12-13 15:41:06 | mark | create | |
|