Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-14 Thread Neal Norwitz
On 3/14/06, Tim Peters <[EMAIL PROTECTED]> wrote: > [Neal Norwitz] > > ... > > The public report says 15, but the current developer report shows 12. > > I'm not sure why there is a discrepancy. All 12 are in ctypes which > > was recently imported. > > I'm having a really hard time making sense of

Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-14 Thread Tim Peters
[Neal Norwitz] > ... > The public report says 15, but the current developer report shows 12. > I'm not sure why there is a discrepancy. All 12 are in ctypes which > was recently imported. I'm having a really hard time making sense of the UI on this. When I looked at the Python project just now (

Re: [Python-Dev] [Python-checkins] Python Regression Test Failuresrefleak (1)

2006-03-14 Thread Raymond Hettinger
>> Raymond is on it, anyway: >> >> http://python.org/sf/1444398 > > You found it, you fix it :-) I've got this one. Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail

Re: [Python-Dev] [Python-checkins] Python Regression Test Failures refleak (1)

2006-03-14 Thread Tim Peters
[Thomas Wouters] > I did the same narrowing-down last week, and submitted a patch to add > cycle-GC support to itertools.tee . It really needs it. I agree. > Come to think of it, now that I remember how to properly do GC, I think > the patch cuts some corners, but it solved the problem. You mean

Re: [Python-Dev] [Python-checkins] r43022 - in python/trunk: Modules/xxmodule.c Objects/object.c

2006-03-14 Thread Tim Peters
[M.-A. Lemburg] >> Why do you add these things to the xx module and not the >> _testcapi module where these things should live ? [Neal Norwitz] > Because I'm an idiot? Ah, so _that's_ why you were made the release coordinator ;-) > Thanks for pointing it out, I moved the code. Or maybe that was

Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-14 Thread Fredrik Lundh
Greg Ewing wrote: > Fredrik Lundh wrote: > > > return=NULL; output=junk => out of memory > > return=junk; output=-1 => cannot do this > > return=pointer; output=value => did this, returned value bytes > > > I agree that the design is a bit questionable; > > It sure is. If you get both

[Python-Dev] Deprecated modules going away in 2.5

2006-03-14 Thread Neal Norwitz
Unless I hear shouts *soon*, the following modules will be removed in 2.5: reconvert.py regex # regexmodule.c regex_syntax.py regsub.py lib-old/* # these are the modules under lib-old Para.py codehack.py fmt.py ni.pystatcache.py whatsound.py addpack.py dircmp.pygrep.py

Re: [Python-Dev] Keep default comparisons - or add a second set?

2006-03-14 Thread Guido van Rossum
On 12/28/05, Robert Brewer <[EMAIL PROTECTED]> wrote: > Noam Raphael wrote: > > I don't think that every type that supports equality > > comparison should support order comparison. I think > > that if there's no meaningful comparison (whether > > equality or order), an exception should be raise

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Tim Peters
[Uncle Timmy] ... > Looks like it was running test_bsddb at the time, and the test > framework gave up after waiting 20 minutes for more output. I had one > of those "recently" that waited 20 minutes for output after starting > test_shelve, but it's scrolled off the page. Berkeley DB is fishy. W

Re: [Python-Dev] Making builtins more efficient

2006-03-14 Thread Steven Elliott
On Thu, 2006-03-09 at 08:51 -0800, Raymond Hettinger wrote: > [Steven Elliott] > > As you probably know each access of a builtin requires two hash table > > lookups. First, the builtin is not found in the list of globals. It is > > then found in the list of builtins. > > If someone really cared

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Tim Peters
[Trent Mick] > Yes I've noticed it too. I've had to kill python_d.exe a few times. I > haven't yet had the chance to look into it. I am NOT getting this error > on another Windows Python build slave that I am running in-house for > play. The last run on your Win2K slave that got beyond the compile

Re: [Python-Dev] Octal literals

2006-03-14 Thread Guido van Rossum
(I'm shedding load; cleaning up my inbox in preparation for moving on to Py3K. I'll try to respond to some old mail in the process.) On 2/6/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > Essentially, you need to decide: does type(x) mostly refer to the > protocol that x respects ("interface" plus

Re: [Python-Dev] Topic suggestions from the PyCon feedback

2006-03-14 Thread Anthony Baxter
On Tuesday 14 March 2006 14:22, A.M. Kuchling wrote: > The conclusion I draw from these results: intermediate- or > advanced-level topics of program design are not covered enough, > whether in the Python documentation, in published books and > articles, or in PyCon talks. Please feel free to mine

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Trent Mick
[Tim Peters wrote] >... > I see that your Win2K buildbot slave always dies in the compile step now, with > > """ > -- Build started: Project: pythoncore, Configuration: Debug Win32 -- > > Compiling resources... > generate buildinfo > cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -

Re: [Python-Dev] Py3k branch - please stay out :-)

2006-03-14 Thread Brett Cannon
On 3/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: [SNIP] > In other news, I'd like to nominate Neal Norwitz as the Python 2.5 > "release coordinator". He's already doing a great job doing exactly > what I think a coordinator should be doing. Anthony will remain > release manager, Tim, Martin,

[Python-Dev] Py3k branch - please stay out :-)

2006-03-14 Thread Guido van Rossum
So I created a Py3K branch in subversion. (Due to my slippery fingers it's actually called p3yk -- that's fine, it may keep bystanders out, and it means we can rename it to the proper name when it's more ready for public consumption. :-) My current plans for this branch are simple: I'm going to r

Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-14 Thread Greg Ewing
Fredrik Lundh wrote: > return=NULL; output=junk => out of memory > return=junk; output=-1 => cannot do this > return=pointer; output=value => did this, returned value bytes > I agree that the design is a bit questionable; It sure is. If you get both NULL and -1 returned, how are you

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Tim Peters
[Raymond Hettinger] > FWIW, I've been working on a way to simplify the use of queues with > daemon consumer threads > > Sometimes, I launch one or more consumer threads that wait for a task > to enter a queue and then work on the task. A recurring problem is that > I sometimes need to know if all o

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Guido van Rossum
I think I was thinking of the following: create a semaphore set to zero; the main thread does N acquire operations; each of N workers releases it once after it's done. When the main thread proceeds it knows all workers are done. Doesn't that work? Also, I believe Tim once implemented a barrier lock

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Tim Peters
[Trent Mick, on test_winsound] > I'll do this tonight or tomorrow. Cool! I see that your Win2K buildbot slave always dies in the compile step now, with """ -- Build started: Project: pythoncore, Configuration: Debug Win32 -- Compiling resources... generate buildinfo cl.exe -c -D_WIN32 -

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Raymond Hettinger
> Isn't this a job for threading.BoundedSpemaphore()? I don't see how that would work. ISTM that we need an inverse of a BoundedSemaphore. If it understand it correctly, a BS blocks after some pre-set maximum number of acquires and is used for resources with limited capacity (i.e. a number

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Paul Moore
On 3/14/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Isn't this a job for threading.BoundedSpemaphore()? Not sure I see how. What I think Raymond's after (and certainly what I want) is to queue N tasks, set a counter to N, then wait until the counter goes to zero. I suppose counter = Se

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Paul Moore
On 3/14/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > FWIW, I've been working on a way to simplify the use of queues with daemon > consumer threads > > Sometimes, I launch one or more consumer threads that wait for a task to > enter a > queue and then work on the task. A recurring problem is

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Raymond Hettinger
[Raymond] >> While this is a somewhat rough approach, it is dramatically >> simpler than the alternatives (i.e. wrapping locks around every access to a >> resource or feeding all resource requests to a separate thread via a Queue). [Alexander] > Why is that actually more difficult to write? Consid

Re: [Python-Dev] Another threading idea

2006-03-14 Thread Guido van Rossum
Isn't this a job for threading.BoundedSpemaphore()? On 3/14/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > FWIW, I've been working on a way to simplify the use of queues with daemon > consumer threads > > Sometimes, I launch one or more consumer threads that wait for a task to > enter a > que

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Trent Mick
[Martin v. Loewis wrote] > Tim Peters wrote: > > I'd say instead that they should never be skipped: the real > > difference on your box is the expected _outcome_ in the third > > category. > > That is indeed more reasonable than what I proposed. I'll do this tonight or tomorrow. Trent -- Tren

Re: [Python-Dev] About "Coverity Study Ranks LAMP Code Quality"

2006-03-14 Thread Alexander Schremmer
On Tue, 14 Mar 2006 00:55:52 +0100, "Martin v. Löwis" wrote: > I can understand that position. The bugs they find include potential > security flaws, for which exploits could be created if the results are > freely available. On the other hand, the exploit could be crafted based on reading the SV

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Alexander Schremmer
On Mon, 13 Mar 2006 21:57:59 -0500, Raymond Hettinger wrote: > Think of it as "non-cooperative" > multi-threading. While this is a somewhat rough approach, it is dramatically > simpler than the alternatives (i.e. wrapping locks around every access to a > resource or feeding all resource request

[Python-Dev] Another threading idea

2006-03-14 Thread Raymond Hettinger
FWIW, I've been working on a way to simplify the use of queues with daemon consumer threads Sometimes, I launch one or more consumer threads that wait for a task to enter a queue and then work on the task. A recurring problem is that I sometimes need to know if all of the tasks have been comp

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Martin v. Löwis
Raymond Hettinger wrote: > Once place where we already have CPython specific support is in > sys.setcheckinterval(). That suggests adapting that function or adding a new > one to temporarily stop switching, almost the same as > sys.setcheckinterval(sys.maxint) but continuing to perform other p

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Martin v. Löwis
Tim Peters wrote: > I'd say instead that they should never be skipped: the real > difference on your box is the expected _outcome_ in the third > category. That is indeed more reasonable than what I proposed. Regards, Martin ___ Python-Dev mailing list

Re: [Python-Dev] Topic suggestions from the PyCon feedback

2006-03-14 Thread Jan Claeys
Op ma, 13-03-2006 te 19:52 -0800, schreef Alex Martelli: > The *ONE* thing I dislike about working in the US is vacations -- I > get about half of what I would expect in Europe, and that's with my > employer being reasonably generous... in practice, given I NEED some > time to go visit family

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Tim Peters
[Phillip J. Eby] > Well, I'm showing my age here, but in the good ol' days of the 8086 > processor, I recall it frequently being used to describe a block of > assembly code which ran with interrupts disabled - ensuring that no task > switching would occur. According to Wikipedia's current article

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Guido van Rossum
On 3/14/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 02:21 PM 3/14/2006 -0500, Tim Peters wrote: > >The common meaning is: > > > > a section of code such that, once a thread enters it, all other > > threads are blocked from entering the section for the duration > > That doesn't seem l

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Tim Peters
[Raymond Hettinger] > ... > I disagree that the need is rare. My own use case is that I sometimes > add some debugging print statements that need to execute > atomically -- it is a PITA because PRINT_ITEM and PRINT_NEWLINE > are two different opcodes and are not guaranteed to pair atomically. Wel

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Phillip J. Eby
At 02:21 PM 3/14/2006 -0500, Tim Peters wrote: >There _is_ some variation in what "critical section" means, exactly, >to different thread programming cultures, but in none does it mean: > > a section of code such that, once a thread enters it, all other > threads are blocked from doing anyt

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Tim Peters
[Raymond Hettinger] >> FWIW, the new with-statement makes the above fragment even more >> readable: >> >> with atomic_transaction(): >> # do a series of steps without interruption [Phillip J. Eby] > +1 on the idea, -1000 on the name. It's neither atomic nor a > transaction. I believe

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Thomas Wouters
On 3/14/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: Once place where we already have CPython specific support is insys.setcheckinterval().  That suggests adapting that function or adding a newone to  temporarily stop switching, almost the same assys.setcheckinterval (sys.maxint) but continuing

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Raymond Hettinger
[Nice analysis from Michael Chermside] > The concept of a "critical section" makes great sense when there is > effectively only one CPU: just stop switching threads. But if code > is using multiple CPUs, what does it mean? Shut down the other CPUs? . . . > I think it is unwise to build such a > fe

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Michael Chermside
Josiah Carlson writes: > It would be nice if Jython or IronPython could (and would) implement > these 'critical sections'. Whether they can or not, I think that it > would be a useful feature in the CPython runtime. The issue is not whether Jython and IronPython "will", it's whether they "can". E

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Josiah Carlson
Samuele Pedroni <[EMAIL PROTECTED]> wrote: > > Raymond Hettinger wrote: > > > [Samuele Pedroni] > > > >> there's no sys.checkinterval in Jython. Implementing this would need the > >> introduction of some kind of GIL implementation in Jython, the JVM > >> has no primitive for global critical sec

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Donovan Baarda
On Tue, 2006-03-14 at 00:36 -0500, Raymond Hettinger wrote: > [Guido] > > Oh, no! > > Before shooting this one down, consider a simpler incarnation not involving > the > GIL. The idea is to allow an active thread to temporarily suspend switching > for > a few steps: [...] > I disagree that th

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Tim Peters
[Mark Hammond] > Maybe the following VBScript "port" of the above will work: > > -- check_soundcard.vbs > rem Check for a working sound-card - exit with 0 if OK, 1 otherwise. > set wmi = GetObject("winmgmts:") > set scs = wmi.InstancesOf("win32_sounddevice") > for each sc in scs > set status =

Re: [Python-Dev] Still looking for volunteer to run Windows buildbot

2006-03-14 Thread Tim Peters
[Trent Mick] > I have a patch in the works that defaults to "yes, this machine does > have a soundcard" if cscript.exe cannot be found on the PATH. > > However, one wrinkle: test_winsound.py is made up of three test cases: > BeepTest > MessageBeepTest > PlaySoundTest > only the last nee

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Donovan Baarda
On Mon, 2006-03-13 at 21:06 -0800, Guido van Rossum wrote: > Oh, no! Please! > > I just had to dissuade someone inside Google from the same idea. Heh... that was me... I LOL'ed when I saw this... and no, I didn't put Raymond up to it :-) > IMO it's fatally flawed for several reasons: it doesn't

Re: [Python-Dev] Strange behavior in Python 2.5a0 (trunk) --- possible error in AST?

2006-03-14 Thread Nick Coghlan
Nick Coghlan wrote: > Unfortunately my new test case breaks test_compiler. I didn't notice because > I > didn't use -uall before checking it in :( > > If no-one else gets to it, I'll try to sort it out tonight. OK, as of rev 43025 the compiler module also understands augmented assignment to tu

Re: [Python-Dev] Developing/patching ctypes (was: Re: integrating ctypes into python)

2006-03-14 Thread Barry Warsaw
On Mon, 2006-03-13 at 21:38 -0800, Neal Norwitz wrote: > On 3/9/06, Thomas Heller <[EMAIL PROTECTED]> wrote: > > Would it be a solution to move the 'official' ctypes development into > > Python SVN external/ctypes, or would this be considered abuse? Another > > location in SVN could be used as wel

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Samuele Pedroni
Raymond Hettinger wrote: > [Samuele Pedroni] > >> there's no sys.checkinterval in Jython. Implementing this would need the >> introduction of some kind of GIL implementation in Jython, the JVM >> has no primitive for global critical sections. > > > Wouldn't Java implement this directly by suspend

Re: [Python-Dev] Threading idea -- exposing a global thread lock

2006-03-14 Thread Raymond Hettinger
[Samuele Pedroni] > there's no sys.checkinterval in Jython. Implementing this would need the > introduction of some kind of GIL implementation in Jython, the JVM has no > primitive for global critical sections. Wouldn't Java implement this directly by suspending and resuming the other threads (b

Re: [Python-Dev] Developing/patching ctypes

2006-03-14 Thread Thomas Heller
Neal Norwitz wrote: > On 3/9/06, Thomas Heller <[EMAIL PROTECTED]> wrote: >> Would it be a solution to move the 'official' ctypes development into >> Python SVN external/ctypes, or would this be considered abuse? Another >> location in SVN could be used as well, if external is though to contain >>