Logged In: YES
user_id=80475
Yes. I worked through your second patch and fixed a
couple of minor errors (old_sz was declared or set).
Then, I tested and timed it.
The code had enough complexity that it took over an hour
to prove that it worked and had no other hidden bugs.
That presents a bit of a maitainability issue.
My abbreviated approach solved the quadratic time
problem but does consume a memory multiple beyond
your version.
Ordinarily, that isn't an issue were worry about, but I
presume that the reason someone is using the array
module is that they have space constraints. This string
representation itself is going to be much larger than the
array object (a four byte long, takes ten digits plus a space
and a comma). The question is whether there is a use
case for repr() instead of tofile() or tostring() in a situation
where there is just enough memory for the array object
and it's string representation but not enough for an
intermediate list object.
If you think it is critical, we can apply the fixed-up version
of your patch. But think carefully about whether it is
worth the code complexity, maintainability challenges,
increased coupling, and the duplication of list.repr code.
|