Re: [Python-Dev] epoll implementation

2006-05-27 Thread Martin v. Löwis
Ross Cohen wrote: epoll also allows 64 bits of data to be tucked away and returned when events happen. Could be useful for saving a dict lookup for every event. However, there are some refcounting issues. Dict lookup per event could be traded for one on deregistration. All it needs is a small

Re: [Python-Dev] warnings about missing __init__.py in toplevel directories

2006-05-27 Thread Martin v. Löwis
Ronald Oussoren wrote: Some time ago a warning was introduced for directories on sys.path that don't contain an __init__.py but have the same name as a package/ module that is being imported. Is it intentional that this triggers for toplevel imports? These warnings are triggered in the

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Martin v. Löwis
Greg Ewing wrote: There are many different select-like things around now (select, poll, epoll, kqueue -- are there others?) and random combinations of them seem to be available on any given platform. This makes writing platform-independent code that needs select-like functionality very

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Martin v. Löwis
Alex Martelli wrote: Of course that would mean establishing which *was* the best available which, as we've seen this week, may not be easy. I believe it's: kqueue on FreeBSD ... Such a statement assumes they are semantically equivalent. However, I believe they aren't. A specific usage

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Ross Cohen
On Sat, May 27, 2006 at 08:36:12AM +0200, Martin v. Löwis wrote: Ross Cohen wrote: epoll also allows 64 bits of data to be tucked away and returned when events happen. Could be useful for saving a dict lookup for every event. However, there are some refcounting issues. Dict lookup per event

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Ross Cohen
On Sat, May 27, 2006 at 02:27:20AM +0100, Steve Holden wrote: Greg Ewing wrote: Rather than adding yet another platform-dependent module, I'd like to see a unified Python interface in the stdlib that uses whichever is the best one available. Of course that would mean establishing which

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Greg Ewing
Alex Martelli wrote: On May 26, 2006, at 6:27 PM, Steve Holden wrote: Of course that would mean establishing which *was* the best available which, as we've seen this week, may not be easy. I believe it's: kqueue on FreeBSD (for recent-enough versions thereof), otherwise epoll where

Re: [Python-Dev] epoll implementation

2006-05-27 Thread Martin v. Löwis
Ross Cohen wrote: The first thing any user of the poll interface does with the file descriptor is map it to some state object. That's where the lookup can be saved, the object can just be handed back directly. Problem being that when the fd is unregistered, we won't get back the PyObject

Re: [Python-Dev] Need for Speed Sprint status

2006-05-27 Thread Tim Peters
http://wiki.python.org/moin/NeedForSpeed/Successes http://wiki.python.org/moin/NeedForSpeed/Failures http://wiki.python.org/moin/NeedForSpeed/Deferred And http://wiki.python.org/moin/ListOfPerformanceRelatedPatches All of these are linked to from the top page:

Re: [Python-Dev] [Python-checkins] This

2006-05-27 Thread Martin v. Löwis
Terry Reedy wrote: Just end user experience's two cents here (btw, this line is correct at English level?) Since you asked...your question would be better written is this line correct English? And the line before, while not formal English of the kind needed, say, for Decimal docs, works

Re: [Python-Dev] Need for Speed Sprint status

2006-05-27 Thread Steve Holden
Neal Norwitz wrote: First off, good work to everyone involved. You did a tremendous job. I just hope to hell you're done, because I can't keep up! :-) Not quite done yet, but I will be encouraging the team to start wrapping up in time to draw a line under everything that *isn't* going to

Re: [Python-Dev] Proposal for a new itertools function: iwindow

2006-05-27 Thread Aahz
On Thu, May 25, 2006, Torsten Marek wrote: Some open question remain: - should iwindow return lists or tuples? - what happens if the length of the iterable is smaller than the window size, and no padding is specified? Is this an error? Should the generator return no value at all or one

Re: [Python-Dev] A Horrible Inconsistency

2006-05-27 Thread Aahz
On Fri, May 26, 2006, Fredrik Lundh wrote: and while we're at it, let's fix this: 0.66 * (1, 2, 3) (1, 2) and maybe even this 0.5 * (1, 2, 3) (1, 1) but I guess the latter one might need a pronunciation. This should certainly get fixed in 3.0 thanks to

Re: [Python-Dev] [Python-checkins] r46300 - in python/trunk: Lib/socket.py Lib/test/test_socket.py Lib/test/test_struct.py Modules/_struct.c Modules/arraymodule.c Modules/socketmodule.c

2006-05-27 Thread Bob Ippolito
On May 26, 2006, at 4:56 PM, Guido van Rossum wrote: On 5/26/06, martin.blais [EMAIL PROTECTED] wrote: Log: Support for buffer protocol for socket and struct. * Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer protocol (send and sendto already did). *

Re: [Python-Dev] warnings about missing __init__.py in toplevel directories

2006-05-27 Thread Ronald Oussoren
On 27-mei-2006, at 8:49, Martin v. Löwis wrote: Ronald Oussoren wrote: Some time ago a warning was introduced for directories on sys.path that don't contain an __init__.py but have the same name as a package/ module that is being imported. Is it intentional that this triggers for

[Python-Dev] getting rid of confusing expected a character buffer object messages

2006-05-27 Thread Fredrik Lundh
several string methods accepts either strings or objects that support the buffer api, and ends up raising a expected a character buffer object error if you pass in something else. this isn't exactly helpful for non-experts -- the term character buffer object doesn't appear in any python

Re: [Python-Dev] Proposal for a new itertools function: iwindow

2006-05-27 Thread Giovanni Bajo
Aahz [EMAIL PROTECTED] wrote: Some open question remain: - should iwindow return lists or tuples? - what happens if the length of the iterable is smaller than the window size, and no padding is specified? Is this an error? Should the generator return no value at all or one window that is too

Re: [Python-Dev] Proposal for a new itertools function: iwindow

2006-05-27 Thread Raymond Hettinger
Aahz [EMAIL PROTECTED] wrote: Some open question remain: - should iwindow return lists or tuples? - what happens if the length of the iterable is smaller than the window size, and no padding is specified? Is this an error? Should the generator return no value at all or one window that is too

Re: [Python-Dev] getting rid of confusing expected a character bufferobject messages

2006-05-27 Thread Terry Reedy
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] several string methods accepts either strings or objects that support the buffer api, and ends up raising a expected a character buffer object error if you pass in something else. this isn't exactly helpful for

Re: [Python-Dev] [Python-checkins] This

2006-05-27 Thread Terry Reedy
Martin v. Löwis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Terry Reedy wrote: Just end user experience's two cents here (btw, this line is correct at English level?) Since you asked...your question would be better written is this line correct English? And the line before,

Re: [Python-Dev] Need for Speed Sprint status

2006-05-27 Thread Terry Reedy
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It looks like there were a lot of additions to the string test suite, that's great. I'm not sure if the other areas touched got similar boosts to their tests. It would be good to upgrade all tests to verify corner cases

Re: [Python-Dev] [Python-checkins] This

2006-05-27 Thread Greg Ewing
Martin v. Löwis wrote: Just end user experience's two cents here (btw, this line is correct at English level?) Wouldn't it be still be conventional to have an article somewhere? e.g. Just /some/ end user's two cents here Or Just two cents' worth of end-user experience here, which is almost

Re: [Python-Dev] Proposal for a new itertools function: iwindow

2006-05-27 Thread Nick Coghlan
Raymond Hettinger wrote: Aahz [EMAIL PROTECTED] wrote: Some open question remain: - should iwindow return lists or tuples? - what happens if the length of the iterable is smaller than the window size, and no padding is specified? Is this an error? Should the generator return no value at all

Re: [Python-Dev] Proposal for a new itertools function: iwindow

2006-05-27 Thread Raymond Hettinger
From: Nick Coghlan [EMAIL PROTECTED] A python-dev Google search for itertools window found me your original suggestion to include Jack Diedrich's itertools.window in Python 2.3 (which was only deferred because 2.3 was already past beta 1 at that point). I couldn't find any discussion of the