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

2006-03-13 Thread Travis E. Oliphant
I'm seeing strange behavior in the Python 2.5a0 trunk that is causing the tests for numpy to fail. Apparently obj[...] = 1 is not calling PyObject_SetItem Here is a minimal example to show the error. Does anyone else see this? class temp(object): def __setitem__(self, obj, v):

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

2006-03-13 Thread Michael Hudson
Travis E. Oliphant [EMAIL PROTECTED] writes: I'm seeing strange behavior in the Python 2.5a0 trunk that is causing the tests for numpy to fail. Apparently obj[...] = 1 is not calling PyObject_SetItem Here is a minimal example to show the error. Does anyone else see this? class

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

2006-03-13 Thread Nick Coghlan
Michael Hudson wrote: Travis E. Oliphant [EMAIL PROTECTED] writes: I'm seeing strange behavior in the Python 2.5a0 trunk that is causing the tests for numpy to fail. Apparently obj[...] = 1 is not calling PyObject_SetItem Here is a minimal example to show the error. Does anyone else

Re: [Python-Dev] Coverity Open Source Defect Scan of Python

2006-03-13 Thread Michael Chermside
Dennis Allison writes: I'd also encourage Coventry to explain their business model a bit more clearly. Ben Chelf writes: Of course it's no surprise that I see open source projects everywhere -- as part of infrastructure or part of code bases that people are developing. So from a Coverity

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

2006-03-13 Thread fermigier
http://www.internetnews.com/dev-news/article.php/3589361 Perl had a defect density of only 0.186. In comparison Python had a defect density of 0.372 and PHP was actually above both the baseline and LAMP averages at 0.474. This is of course a PR stunt. But I'm wondering if the actual bugs list

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

2006-03-13 Thread Fredrik Lundh
fermigier [EMAIL PROTECTED] wrote: Perl had a defect density of only 0.186. In comparison Python had a defect density of 0.372 and PHP was actually above both the baseline and LAMP averages at 0.474. This is of course a PR stunt. But I'm wondering if the actual bugs list was transmitted to

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

2006-03-13 Thread Fredrik Lundh
fermigier wrote: But I'm wondering if the actual bugs list was transmitted to Python developers, and verified / acted upon. and in case it wasn't clear from my previous post, the answer to your specific question is yes ;-) /F ___ Python-Dev

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

2006-03-13 Thread Travis E. Oliphant
Nick Coghlan wrote: And how... case Ellipsis_kind: ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts) break; Just a couple of minor details missing, like, oh, compiling the actual subscript operation :) Bug here: http://www.python.org/sf/1448804 (assigned to myself, since

Re: [Python-Dev] Coverity Open Source Defect Scan of Python

2006-03-13 Thread Scott David Daniels
Michael Chermside wrote: (PS: too bad I can't buy stock in Coverity. How come all the GOOD companies are private? I had to wait around 6 years before I could buy stock in Google.) Maybe because the companies whose stock is available early are companies bent on producing stock profits, rather

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

2006-03-13 Thread Trent Mick
[Tim Peters wrote] This touches on something we (including Martin) should think about: it's very painful to build a full Python on Windows because of these external packages... Yup. That is part of what I meant by updating PCBuild\readme.txt below: to improve the instructions so the

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

2006-03-13 Thread Thomas Heller
Trent Mick wrote: Yup. Looks like my build worked. Another TODO now though: - Figure out why usage of: winsound.PlaySound(something, winsound.SND_ALIAS) fails on my Win2k box. This is why the test suite fails on that box. Doesn't that always fail when there is no soundcard in the

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

2006-03-13 Thread Trent Mick
[Thomas Heller wrote] Trent Mick wrote: Yup. Looks like my build worked. Another TODO now though: - Figure out why usage of: winsound.PlaySound(something, winsound.SND_ALIAS) fails on my Win2k box. This is why the test suite fails on that box. Doesn't that always fail

[Python-Dev] decorator module patch

2006-03-13 Thread Jim Jewett
Raymond Hettinger wrote: In contrast, a name like functional suggests that some of these tools don't quite fit. The original intent was that the functional module become the home of typical utilities for functional style programming. partial was there were patches (such as 1412451) providing

[Python-Dev] Making builtins more efficient

2006-03-13 Thread Jim Jewett
Paul Moore wrote: Is there any practical way of detecting and flagging constructs like the above (remotely shadowing a builtin in another module)? Phillip J. Eby wrote: the patch ended up being backed out ... too strict of a check to be accepted for Python 2.4.

Re: [Python-Dev] Making builtins more efficient

2006-03-13 Thread Samuele Pedroni
Phillip J. Eby wrote: At 02:47 PM 3/13/2006 -0500, Jim Jewett wrote: Paul Moore wrote: Is there any practical way of detecting and flagging constructs like the above (remotely shadowing a builtin in another module)? Phillip J. Eby wrote: the patch ended up being backed out ... too strict of

[Python-Dev] Why are so many built-in types inheritable?

2006-03-13 Thread Fabiano Sidler
Hi folks! Let me explain the above question: For debugging purpose I tried this: --- snip --- def foo(): pass function = type(foo) class PrintingFunction(function): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): print args, kwargs return

Re: [Python-Dev] Making builtins more efficient

2006-03-13 Thread Phillip J. Eby
At 02:47 PM 3/13/2006 -0500, Jim Jewett wrote: Paul Moore wrote: Is there any practical way of detecting and flagging constructs like the above (remotely shadowing a builtin in another module)? Phillip J. Eby wrote: the patch ended up being backed out ... too strict of a check to be

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

2006-03-13 Thread Nick Coghlan
Travis E. Oliphant wrote: Nick Coghlan wrote: And how... case Ellipsis_kind: ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts) break; Just a couple of minor details missing, like, oh, compiling the actual subscript operation :) Bug here: http://www.python.org/sf/1448804

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

2006-03-13 Thread Martin v. Löwis
Trent Mick wrote: This touches on something we (including Martin) should think about: it's very painful to build a full Python on Windows because of these external packages... Yup. That is part of what I meant by updating PCBuild\readme.txt below: to improve the instructions so the

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

2006-03-13 Thread Trent Mick
[Martin v. Loewis wrote] I took an approach with a little more automation: Tools/buildbot/external.bat gradually learns how to fetch and build the necessary prerequisites; to avoid moving URLs, these come from the external/ directory of the projects svn (in case of bsddb, this already has the

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

2006-03-13 Thread Martin v. Löwis
Trent Mick wrote: I do have a sound card in that box, however, the Sounds and Multimedia Properties dialog (off Control Panel) says that there are No Playback Devices for Sound Playback. So I guess that is it. Maybe the sound card in that box is not hooked up. Grrr. I certainly don't care

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

2006-03-13 Thread Greg Ewing
Fredrik Lundh wrote: But I'm wondering if the actual bugs list was transmitted to Python developers, and verified / acted upon. and in case it wasn't clear from my previous post, the answer to your specific question is yes ;-) Could whoever did this perhaps post a brief description of

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

2006-03-13 Thread Jeff Epler
On Mon, Mar 13, 2006 at 03:05:55PM +, fermigier wrote: Because according to http://www.washingtontechnology.com/news/1_1/daily_news/28134-1.html : The maintainers of the source codes can register with Coverity to see the full results. (End users cannot see the bug lists themselves; they

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

2006-03-13 Thread Martin v. Löwis
Jeff Epler wrote: Because according to http://www.washingtontechnology.com/news/1_1/daily_news/28134-1.html : The maintainers of the source codes can register with Coverity to see the full results. (End users cannot see the bug lists themselves; they will be able to see how buggy a particular

[Python-Dev] checkin r43015

2006-03-13 Thread Jeff Epler
After the recent discussion about Coverity, I took a look at one of the checkins made, apparently based on output from their tool. http://svn.python.org/view/python/branches/release24-maint/Objects/object.c?r1=43015r2=43014rev=43015view=diffdiff_format=l This change, a backport of a similar

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

2006-03-13 Thread Trent Mick
[Martin v. Loewis wrote] Trent Mick wrote: I do have a sound card in that box, however, the Sounds and Multimedia Properties dialog (off Control Panel) says that there are No Playback Devices for Sound Playback. So I guess that is it. Maybe the sound card in that box is not hooked up.

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

2006-03-13 Thread Mark Hammond
Roger on python-win32 had an answer which works for me: [Roger Upole wrote] WMI can list sound devices. import win32com.client wmi=win32com.client.GetObject('winmgmts:') scs=wmi.InstancesOf('win32_sounddevice') for sc in scs: print

[Python-Dev] Topic suggestions from the PyCon feedback

2006-03-13 Thread A.M. Kuchling
Those of you on python-checkins will have noticed the recent fiddling around with the feedback from PyCon. I'd like to draw the attention of the python-dev readership to the answers for the question What 3 topics should have been covered at PyCon? I split out core Python and web-related topics

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

2006-03-13 Thread Raymond Hettinger
A user on comp.lang.python has twisted himself into knots writing multi-threaded code that avoids locks and queues but fails when running code with non-atomic access to a shared resource. While his specific design is somewhat flawed, it does suggest that we could offer an easy way to make a

Re: [Python-Dev] checkin r43015

2006-03-13 Thread Hye-Shik Chang
On 3/14/06, Jeff Epler [EMAIL PROTECTED] wrote: After the recent discussion about Coverity, I took a look at one of the checkins made, apparently based on output from their tool.

Re: [Python-Dev] Why are so many built-in types inheritable?

2006-03-13 Thread Alex Martelli
On Mar 13, 2006, at 12:29 PM, Fabiano Sidler wrote: Hi folks! Hello Fabiano! The proper venue for your interesting issues is comp.lang.python (or the equivalent mailing list), where all sorts of people will be able to hear you, discuss things, and help out. python-dev is strictly for

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

2006-03-13 Thread Trent Mick
[Mark Hammond wrote] Maybe the following VBScript port of the above will work: ... Cool, yes that works. Running cscript.exe check_soundcard.vbs and checking the return code should work. cscript.exe comes with all modern Windows variants, and although there may be ways to install Windows

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

2006-03-13 Thread Phillip J. Eby
At 09:57 PM 3/13/2006 -0500, Raymond Hettinger wrote: FWIW, the new with-statement makes the above fragment even more readable: with atomic_transaction(): # do a series of steps without interruption +1 on the idea, -1000 on the name. It's neither atomic nor a transaction. I

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

2006-03-13 Thread Neal Norwitz
On 3/13/06, Greg Ewing [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: But I'm wondering if the actual bugs list was transmitted to Python developers, and verified / acted upon. and in case it wasn't clear from my previous post, the answer to your specific question is yes ;-) 16

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

2006-03-13 Thread Guido van Rossum
Oh, no! Please! I just had to dissuade someone inside Google from the same idea. IMO it's fatally flawed for several reasons: it doesn't translate reasonably to Jython or IronPython, it's really tricky to implement, and it's an invitation for deadlocks. The danger of this thing in the wrong

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

2006-03-13 Thread Barry Warsaw
On Mon, 2006-03-13 at 23:06 -0500, Phillip J. Eby wrote: +1 on the idea, -1000 on the name. It's neither atomic nor a transaction. I believe that critical section is a more common term for what you're proposing. Probably the primitive could be placed in the thread or threading module,

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

2006-03-13 Thread Raymond Hettinger
[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: threading.stop_switching() # step1 # step2 # setp3 theading.resume_switching() To me, this version is

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

2006-03-13 Thread Neal Norwitz
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 only vendor drops... Thomas,

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

2006-03-13 Thread Raymond Hettinger
it doesn't translate reasonably to Jython or IronPython, it's really tricky to implement, FWIW, someone on the newsgroup suggested implementing this via a slight modification to sys.checkinterval(). The idea was that a None argument would translate to stop-checking and the active thread

Re: [Python-Dev] checkin r43015

2006-03-13 Thread Neal Norwitz
On 3/13/06, Hye-Shik Chang [EMAIL PROTECTED] wrote: On 3/14/06, Jeff Epler [EMAIL PROTECTED] wrote: After the recent discussion about Coverity, I took a look at one of the checkins made, apparently based on output from their tool.

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

2006-03-13 Thread Samuele Pedroni
Raymond Hettinger wrote: it doesn't translate reasonably to Jython or IronPython, it's really tricky to implement, FWIW, someone on the newsgroup suggested implementing this via a slight modification to sys.checkinterval(). The idea was that a None argument would translate to

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

2006-03-13 Thread Martin v. Löwis
Trent Mick wrote: 1. Use TestSkipped and skip all three test cases if there is not sound card. Running the test suite will actually show that something is being skipped. This is best. The sound tests are not that important that they absolutely need to be run. Regards, Martin