Message14447
This is a bug and a partial patch.
If I debug a program that contains a ridiculously large array (8M entries in my case), the debugger takes forever.
It happens in Mac OS X, Python 2.2, but I found the bug in is the repr module, so it is probably universal.
The thing is, that after the fix below, it still doesn't work!
Did I miss something trivial (like repr is builtin, or something like that?). Would someone with Mac OS X experience help out here, please (Jack?).
Here's the diff to make repr.repr work with large arrays:
13a14
> self.maxarray = 5
50a52,62
> def repr_array(self, x, level):
> n = len(x)
> header = "array('"+x.typecode+"', ["
> if n == 0: return header+"])"
> if level <= 0: return header+"...])"
> s = ''
> for i in range(min(n, self.maxarray)):
> if s: s = s + ', '
> s = s + self.repr1(x[i], level-1)
> if n > self.maxarray: s = s + ', ...'
> return header + s + "])" |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:10:47 | admin | link | issue680789 messages |
| 2007-08-23 14:10:47 | admin | create | |
|