[Python-Dev] Things to remember when adding *packages* to stdlib

2006-06-21 Thread Neal Norwitz
I believe this change is all that's necessary on the Unix side to install wsgiref. Can someone please update the Windows build files to ensure wsgiref is installed in b2? Don't forget to update the NEWS entry too. Also, all committers and reviewers, try to remember that when a package (meaning d

Re: [Python-Dev] PyRange_New() alternative?

2006-06-21 Thread Georg Brandl
Ralf W. Grosse-Kunstleve wrote: > http://docs.python.org/dev/whatsnew/ports.html says: > > The PyRange_New() function was removed. It was never documented, never used > in the core code, and had dangerously lax error checking. > > I use this function (don't remember how I found it; this was yea

Re: [Python-Dev] ImportWarning flood

2006-06-21 Thread Martin v. Löwis
Ralf W. Grosse-Kunstleve wrote: > Is there a way to set the warning options via an environment variable? This is off-topic for python-dev, but: why don't switch off the warnings in the code? Regards, Martin ___ Python-Dev mailing list Python-Dev@python.

[Python-Dev] Weekly Python Patch/Bug Summary

2006-06-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 378 open ( +3) / 3298 closed (+34) / 3676 total (+37) Bugs: 886 open (-24) / 5926 closed (+75) / 6812 total (+51) RFE : 224 open ( +7) / 227 closed ( +7) / 451 total (+14) New / Reopened Patches __ Improve s

Re: [Python-Dev] ImportWarning flood

2006-06-21 Thread Ralf W. Grosse-Kunstleve
--- Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 6/21/06, Ralf W. Grosse-Kunstleve <[EMAIL PROTECTED]> wrote: > > I am getting tons of "ImportWarning: Not importing directory". See below > for > > examples. It is impractical for me to reorganize our directory structure. > I'd > > be busy for a

Re: [Python-Dev] ImportWarning flood

2006-06-21 Thread Guido van Rossum
On 6/21/06, Ralf W. Grosse-Kunstleve <[EMAIL PROTECTED]> wrote: > I am getting tons of "ImportWarning: Not importing directory". See below for > examples. It is impractical for me to reorganize our directory structure. I'd > be busy for a week or more and people would probably scream at me because

[Python-Dev] Allow assignments in 'global' statements?

2006-06-21 Thread Talin
I'm sure I am not the first person to say this, but how about: global x = 12 (In other words, declare a global and assign a value to it - or another way of saying it is that the 'global' keyword acts as an assignment modifier.) -- Talin ___ Pytho

Re: [Python-Dev] Switch statement

2006-06-21 Thread Talin
Phillip J. Eby wrote: > At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: > >>BTW a switch in a class should be treated the same as a global switch. >>But what about a switch in a class in a function? > > > Okay, now my head hurts. :) > > A switch in a class doesn't need to be treated the s

[Python-Dev] ImportWarning flood

2006-06-21 Thread Ralf W. Grosse-Kunstleve
http://docs.python.org/dev/whatsnew/other-lang.html says: > One error that Python programmers sometimes make is forgetting to > include an __init__.py module in a package directory. Debugging this > mistake can be confusing, and usually requires running Python with the > -v switch to log all the

[Python-Dev] doc for new restricted execution design for Python

2006-06-21 Thread Brett Cannon
I have been working on a design doc for restricted execution of Python as part of my dissertation for getting Python into Firefox to replace JavaScript on the web. Since this is dealing with security and messing that up can be costly, I am sending it to the list for any possible feedback. I have

[Python-Dev] PyRange_New() alternative?

2006-06-21 Thread Ralf W. Grosse-Kunstleve
http://docs.python.org/dev/whatsnew/ports.html says: The PyRange_New() function was removed. It was never documented, never used in the core code, and had dangerously lax error checking. I use this function (don't remember how I found it; this was years ago), therefore my code doesn't compile w

Re: [Python-Dev] Code coverage reporting.

2006-06-21 Thread Walter Dörwald
Titus Brown wrote: > On Mon, Jun 19, 2006 at 08:37:30AM -0400, Benji York wrote: > -> Brett Cannon wrote: > -> >But it does seem accurate; random checking of some modules that got high > -> >but not perfect covereage all seem to be instances where dependency > -> >injection would be required to

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Nick Maclaren
Michael Hudson <[EMAIL PROTECTED]> wrote: > > This mail never appeared on python-dev as far as I can tell, so I'm > not snipping anything. And it still hasn't :-( I am on the list of recipients without posting rights, and the moderator appears to be on holiday. > >>> As I have posted to comp.l

Re: [Python-Dev] Code coverage reporting.

2006-06-21 Thread Titus Brown
On Sun, Jun 18, 2006 at 08:12:39PM -0700, Brett Cannon wrote: -> On 6/15/06, Titus Brown <[EMAIL PROTECTED]> wrote: -> > -> >Folks, -> > -> >I've just run a code coverage report for the python2.4 branch: -> > -> >http://vallista.idyll.org/~t/temp/python2.4-svn/ -> > -> >This report uses my

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Nick Maclaren
Michael Hudson <[EMAIL PROTECTED]> wrote: > > > As I have posted to comp.lang.python, I am not happy with Python's > > numerical robustness - because it basically propagates the 'features' > > of IEEE 754 and (worse) C99. > > That's not really now I would describe the situation today. It is cer

Re: [Python-Dev] Code coverage reporting.

2006-06-21 Thread Titus Brown
On Mon, Jun 19, 2006 at 08:37:30AM -0400, Benji York wrote: -> Brett Cannon wrote: -> >But it does seem accurate; random checking of some modules that got high -> >but not perfect covereage all seem to be instances where dependency -> >injection would be required to get the tests to work since th

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Nick Maclaren
Brett Cannon's and Neal Norwitz's replies appreciated and noted, but responses sent by mail. Nick Coghlan <[EMAIL PROTECTED]> wrote: > > Python 2.4's decimal module is, in essence, a floating point emulator based > on > the General Decimal Arithmetic specification. Grrk. Format and all? Beca

Re: [Python-Dev] Code coverage reporting.

2006-06-21 Thread Titus Brown
On Mon, Jun 19, 2006 at 02:21:04PM +1000, Nick Coghlan wrote: -> Brett Cannon wrote: -> >But it does seem accurate; random checking of some modules that got high -> >but not perfect covereage all seem to be instances where dependency -> >injection would be required to get the tests to work since

Re: [Python-Dev] TRUNK is UNFROZEN, but in FEATURE FREEZE

2006-06-21 Thread Josiah Carlson
Anthony Baxter <[EMAIL PROTECTED]> wrote: > 2.5b1 is out, so I'm declaring the SVN trunk unfrozen. Note, though, > that as we're now post-beta, we're in FEATURE FREEZE. Hey Raymond, any word on those binascii additions, or should I clean up that struct patch and add in some tests? - Josiah _

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 01:16 PM 6/21/2006 -0700, Guido van Rossum wrote: >On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > >But that's not the discerning rule in my mind; the rule is, how to > > >define "at function definition time". > > > > Wa! (i.e., my head hurts again :) > >Um, wasn't this your propo

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > >> But in most cases the 'constant' is actually an expression involving a > >> global, often even a global in another module. (E.g. sre_compile.py) > >> The compiler will have a hard time proving that this is really a >

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > >But that's not the discerning rule in my mind; the rule is, how to > >define "at function definition time". > > Wa! (i.e., my head hurts again :) Um, wasn't this your proposal (to freeze the case expressions at function definition time)

Re: [Python-Dev] Switch statement

2006-06-21 Thread Fredrik Lundh
Fredrik Lundh wrote: >> But in most cases the 'constant' is actually an expression involving a >> global, often even a global in another module. (E.g. sre_compile.py) >> The compiler will have a hard time proving that this is really a >> constant, so it won't optimize the code. > > unless we come

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 10:27 AM 6/21/2006 -0700, Guido van Rossum wrote: >On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: > > >BTW a switch in a class should be treated the same as a global switch. > > >But what about a switch in a class in a function? > >

Re: [Python-Dev] Switch statement

2006-06-21 Thread Fredrik Lundh
Guido van Rossum wrote: > But in most cases the 'constant' is actually an expression involving a > global, often even a global in another module. (E.g. sre_compile.py) > The compiler will have a hard time proving that this is really a > constant, so it won't optimize the code. unless we come up w

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: > >BTW a switch in a class should be treated the same as a global switch. > >But what about a switch in a class in a function? > > Okay, now my head hurts. :) Welcome to the club. There's

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: >BTW a switch in a class should be treated the same as a global switch. >But what about a switch in a class in a function? Okay, now my head hurts. :) A switch in a class doesn't need to be treated the same as a global switch, because locals(

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 06:41 PM 6/21/2006 +0200, Fredrik Lundh wrote: >Guido van Rossum wrote: > > > (Note how I've switched to the switch-for-efficiency camp, since it > > seems better to have clear semantics and a clear reason for the syntax > > to be different from if/elif chains.) > >if you're now in the efficienc

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 09:16 AM 6/21/2006 -0700, Guido van Rossum wrote: > >After thinking about it a bit I think that if it's not immediately > >contained in a function, it should be implemented as alternative > >syntax for an if/elif chain. > > That worries me

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > (Note how I've switched to the switch-for-efficiency camp, since it > > seems better to have clear semantics and a clear reason for the syntax > > to be different from if/elif chains.) > > if you're now in the effi

Re: [Python-Dev] Switch statement

2006-06-21 Thread Fredrik Lundh
Guido van Rossum wrote: > (Note how I've switched to the switch-for-efficiency camp, since it > seems better to have clear semantics and a clear reason for the syntax > to be different from if/elif chains.) if you're now in the efficiency camp, why not just solve this on the code generator level

[Python-Dev] TRUNK is UNFROZEN, but in FEATURE FREEZE

2006-06-21 Thread Anthony Baxter
2.5b1 is out, so I'm declaring the SVN trunk unfrozen. Note, though, that as we're now post-beta, we're in FEATURE FREEZE. Really. This means you. :-) No new features should be checked in without prior approval - checkins that violate this will quite probably get backed out. I expect that we

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 09:16 AM 6/21/2006 -0700, Guido van Rossum wrote: >After thinking about it a bit I think that if it's not immediately >contained in a function, it should be implemented as alternative >syntax for an if/elif chain. That worries me a little. Suppose I write a one-off script like this: for line

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 03:38 AM 6/21/2006 -0500, Ka-Ping Yee wrote: > >On Wed, 21 Jun 2006, Phillip J. Eby wrote: > > > Well, EIBTI and all that: > > > > > > switch x: > > > case == 1: foo(x) > > > case in S: bar(x) > > > > > > It even line

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > There's some benefit to "first time it's executed" though: >a. it allows access to the local namespace And how would that be a good thing? It just begs for confusion if the local variable doesn't always have the same value. (Yes, globals ma

[Python-Dev] RELEASED Python 2.5 (beta 1)

2006-06-21 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the first BETA release of Python 2.5. This is an *beta* release of Python 2.5. As such, it is not suitable for a production environment. It is being released to solicit feedback and hopefully discover bugs,

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Paul Moore
On 6/21/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Nick Coghlan wrote: > > >> BTW, prove me Decimal is not fast enough, ;) > > > > C:\Python24>python -m timeit -s "x = 1.0" "x+x" > > 1000 loops, best of 3: 0.137 usec per loop > > > > C:\Python24>python -m timeit -s "from decimal import Deci

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Fredrik Lundh
Nick Coghlan wrote: >> BTW, prove me Decimal is not fast enough, ;) > > C:\Python24>python -m timeit -s "x = 1.0" "x+x" > 1000 loops, best of 3: 0.137 usec per loop > > C:\Python24>python -m timeit -s "from decimal import Decimal as d; x = d(1)" > "x+x" > 1 loops, best of 3: 48.3 usec p

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Aahz
On Wed, Jun 21, 2006, Nick Coghlan wrote: > Facundo Batista wrote: >> >> BTW, prove me Decimal is not fast enough, ;) > > C:\Python24>python -m timeit -s "x = 1.0" "x+x" > 1000 loops, best of 3: 0.137 usec per loop > > C:\Python24>python -m timeit -s "from decimal import Decimal as d; x = d(

Re: [Python-Dev] Switch statement

2006-06-21 Thread Phillip J. Eby
At 03:38 AM 6/21/2006 -0500, Ka-Ping Yee wrote: >On Wed, 21 Jun 2006, Phillip J. Eby wrote: > > Well, EIBTI and all that: > > > > switch x: > > case == 1: foo(x) > > case in S: bar(x) > > > > It even lines up nicely. :) > >Hmm, this is rather nice. I can imagine possible us

Re: [Python-Dev] Numerical robustness, IEEE etc.

2006-06-21 Thread Nick Coghlan
Facundo Batista wrote: > 2006/6/20, Nick Coghlan <[EMAIL PROTECTED]>: >> The intent was always to replace the internal use of tuples and longs >> with a >> more efficient C implementation - that particular step simply wasn't >> needed >> for the original use case that lead Facundo to write and im

Re: [Python-Dev] Switch statement

2006-06-21 Thread Nick Coghlan
Greg Ewing wrote: > Phillip J. Eby wrote: > >> Actually, one could consider "case" expressions to be computed at function >> definition time, the way function defaults are. That would solve the >> problem of symbolic constants, or indeed any sort of expressions. > > That's an excellent idea! >

Re: [Python-Dev] Switch statement

2006-06-21 Thread Georg Brandl
Ka-Ping Yee wrote: > On Wed, 21 Jun 2006, Phillip J. Eby wrote: >> Well, EIBTI and all that: >> >> switch x: >> case == 1: foo(x) >> case in S: bar(x) >> >> It even lines up nicely. :) > > Hmm, this is rather nice. I can imagine possible use cases for > > switch x: >

Re: [Python-Dev] Switch statement

2006-06-21 Thread Ka-Ping Yee
On Wed, 21 Jun 2006, Phillip J. Eby wrote: > Well, EIBTI and all that: > > switch x: > case == 1: foo(x) > case in S: bar(x) > > It even lines up nicely. :) Hmm, this is rather nice. I can imagine possible use cases for switch x: case > 3: foo(x) case

Re: [Python-Dev] test_ctypes failure on Mac OS X/PowerPC 10.3.9(Panther)

2006-06-21 Thread Ronald Oussoren
On Wednesday, June 21, 2006, at 09:43AM, Thomas Heller <[EMAIL PROTECTED]> wrote: >Ronald Oussoren schrieb: >>> will have a look. >> >> It is a platform bug, RTLD_LOCAL doesn't work on 10.3. The following C >> snippet fails with the same error as ctypes: FAIL: dlcompat: unable to >> open thi

Re: [Python-Dev] test_ctypes failure on Mac OS X/PowerPC 10.3.9 (Panther)

2006-06-21 Thread Thomas Heller
Ronald Oussoren schrieb: > > On 20-jun-2006, at 20:50, Ronald Oussoren wrote: > >> >> On 20-jun-2006, at 20:06, Thomas Heller wrote: >> >>> Trent Mick schrieb: Thomas and others, Has anyone else seen failures in test_ctypes on older Mac OS X/ PowerPC? Results are below. T