[Python-ideas] Tulip patches

Geert Jansen geertj at gmail.com
Fri Dec 21 22:59:23 CET 2012


On Fri, Dec 21, 2012 at 4:57 PM, Guido van Rossum <guido at python.org> wrote:

> This is a fine place, but you would make my life even easier by
> uploading the patches to codereview.appspot.com, so I can review them
> and send comments in-line.

I tried to get Tulip added as a new repository there, but i'm probably
doing something wrong.. In the mean time i'm sending my updated
patches below..

> I've given you checkin permissions. Please send a contributor form to
> the PSF (http://www.python.org/psf/contrib/contrib-form/).

Done!

>> 0001-run-fd-callbacks.patch
[...]
> Interesting. Go ahead and submit.
[from your other email]
> Whoa! I just figured out the problem. You don't have to run the ready
> queue twice. You just have to set the poll timeout to 0 if there's
> anything in the ready queue. Please send me an updated patch before
> submitting.

New patch attached.

>> 0002-call-every-iteration.patch
[...]
> There's one odd thing here: you remove cancelled everytime handlers
> *after* already scheduling them. It would seem to make more sense to
> schedule them first. Also, a faster way to do this would be
>
>     self._everytime = [handler in self._everytime if not handler.cancelled]
>
> (Even if you iterate from the back, remove() is still O(N), so if half
> the handlers are to be removed, your original code would be O(N**2).)

ACK regarding the comment on O(N^2). The reason i implemented it like
this is that i didn't want to regenerate the list at every iteration
of the loop (maybe i'm unduly worried though...). The attached patch
does as you suggest but only in case there are cancelled handlers.

> PS. If you want to set up a mailing list or other cleverness I can set
> you up as a project admin. (I currently have all patches mailed to me
> but we may want to set up a separate list for that.)

I'm happy to be an admin and set up a Google Groups for this. On the
other hand, tulip is supposed to become part of the standard library,
right? Maybe python-dev is as a good place to discuss tulip? Your
call..

I'll go ahead and commit the two trivial patches, and wait for your
ACK on the updated versions of the other two.

Regards,
Geert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-run-fd-callbacks-v2.patch
Type: application/octet-stream
Size: 3151 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121221/8126bb79/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-call-every-iteration-v2.patch
Type: application/octet-stream
Size: 2791 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121221/8126bb79/attachment-0001.obj>


More information about the Python-ideas mailing list