On Tue, Jan 26, 2010 at 11:36 AM, Steve Howell <showel...@yahoo.com> wrote:
> --- On Tue, 1/26/10, Guido van Rossum <gu...@python.org> wrote:
>
>> From: Guido van Rossum <gu...@python.org>
>> Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time
>> To: "Steve Howell" <showel...@yahoo.com>
>> Cc: "Nick Coghlan" <ncogh...@gmail.com>, python-dev@python.org
>> Date: Tuesday, January 26, 2010, 11:17 AM
>> On Tue, Jan 26, 2010 at 10:01 AM,
>> Steve Howell <showel...@yahoo.com>
>> wrote:
>> > The patch is now on Rietveld.
>> >
>> > http://codereview.appspot.com/194083/show
>> >
>> > I wsa getting HTTP errors for certain operations, like
>> trying to publish comments, but I am able to see the patch
>> there.
>>
>> Hey Steve,
>>
>> You seem to be using Rietveld in a slightly odd fashion
>> which prevents
>> the side-by-side diff and commenting feature fro working.
>>
>> Try downloading Rietveld's "upload.py" script
>> (http://codereview.appspot.com/static/upload.py) and
>> uploading your
>> patch again from your SVN client, using
>>
>>   upload.py -i 194083
>>
>> (This will require the email and password you used to
>> upload the issue
>> in the first place.)
>>
>
> Ok, I just ran upload.py with my patch.  It shows up on Rietveld, but I am 
> still getting 500 errors when I attempt to publish my own comments, so I am 
> not sure what I'm doing wrong.

The first Patch Set is broken, and attempts to add comments to it will
fail. As the issue's owner you can delete the first patch set.

> The version that I just uploaded was my working copy, which was off of the 
> 3.x trunk.
>
> The version that I attempted to upload earlier, via the URL feature, was 
> slightly different--Florent had taken my changes, applied them to 2.x, 
> cleaned up tabs/spaces, and posted his diff to the issue tracker:
>
> http://bugs.python.org/issue7784

So here's how you can fix it: go to "Edit Issue" and change the
"Base:" field to the following:

http://svn.python.org/view/*checkout*/python/trunk/

Note the addition of "trunk/" at the end.

But it's best not to use the same Rietveld Issue for versions
pertaining to different branches.

> The content of both patches is the same otherwise.
>
> I suspect the patch has lots of minor cleanup that needs to be done, but I 
> should point out one major design decision that probably needs to be 
> addressed first.  I chose to store the number of orphans vs. storing the 
> pointer to the originally allocated memory.  There was no rhyme or reason for 
> my decision, other than it was just how I initially got my head around the 
> problem.  The tradeoffs should be pretty obvious--there are places where it's 
> convenient to work with the count, but it comes at the cost of pointer 
> arithmetic in other places.

I'd like you to revisit this design decision. It would make life
harder if we ever switched to a conservative garbage collector. I feel
much more comfortable having a hard pointer to the actual memory block
in my hands rather than having to compute where that block starts
using pointer arithmetic.

Note that I'm not endorsing your patch -- I expect that the number of
(real) use cases that aren't already served better or equally well by
deques is very small, and I fear that the real cost of adding
sizeof(ssize_t) bytes to every list object is real (unless there are 8
bytes unused given the block size rounding happening in obmalloc). I
don't believe a microbenchmark proves much of anything.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to