Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Craig-Wood
On Tue, Oct 03, 2006 at 09:47:03AM +1000, Delaney, Timothy (Tim) wrote: > This doesn't actually give us a very useful indication of potential > memory savings. What I think would be more useful is tracking the > maximum simultaneous count of each value i.e. what the maximum refcount > would have be

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Craig-Wood
On Mon, Oct 02, 2006 at 07:53:34PM -0500, [EMAIL PROTECTED] wrote: > Terry> "Kristján V. Jónsson" <[EMAIL PROTECTED]> wrote: > >> Anyway, Skip noted that 50% of all floats are whole numbers between > >> -10 and 10 inclusive, > > Terry> Please, no. He said something like this about

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Fredrik Lundh
Terry Reedy wrote: > For true floating point measurements (of temperature, for instance), > 'integral' measurements (which are an artifact of the scale used (degrees F > versus C versus K)) should generally be no more common than other realized > measurements. a real-life sensor is of course w

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
"Terry Reedy" <[EMAIL PROTECTED]> wrote: > > For true floating point measurements (of temperature, for instance), > 'integral' measurements (which are an artifact of the scale used (degrees F > versus C versus K)) should generally be no more common than other realized > measurements. Not quite,

Re: [Python-Dev] PEP 315 - do while

2006-10-03 Thread Nick Coghlan
Hans Polak wrote: > Ok, I see your point. Really, I've read more about Python than worked with > it, so I'm out of my league here. > > Can I combine your suggestion with mine and come up with the following: > > do: > > > while > else: > In

Re: [Python-Dev] PEP 315 - do while

2006-10-03 Thread Fuzzyman
Nick Coghlan wrote: >Hans Polak wrote: > > >>Ok, I see your point. Really, I've read more about Python than worked with >>it, so I'm out of my league here. >> >>Can I combine your suggestion with mine and come up with the following: >> >> do: >> >> >> while >>

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Kristján V . Jónsson
But that is precisely the point. A non-floating point application tends to use floating point values in a predictable way, with a lot of integral values floating around and lots of zeroes. As this constitutes the majority of python applications (okay, daring assumption here) it seems to warran

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
=?iso-8859-1?Q?Kristj=E1n_V=2E_J=F3nsson?= <[EMAIL PROTECTED]> wrote: > > The total count of floating point numbers allocated at this point is 985794. > Without the reuse, they would be 1317145, so this is a saving of 25%, and > of 5Mb. And, if you optimised just 0.0, you would get 60% of that sav

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread skip
>> The total count of floating point numbers allocated at this point is >> 985794. Without the reuse, they would be 1317145, so this is a >> saving of 25%, and of 5Mb. Nick> And, if you optimised just 0.0, you would get 60% of that saving Nick> at a small fraction of the cost

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
[EMAIL PROTECTED] wrote: > > Doesn't that presume that optimizing just 0.0 could be done easily? Suppose > 0.0 is generated all over the place in EVE? Yes, and it isn't, respectively! The changes in floatobject.c would be trivial (if tedious), and my recollection of my scan is that floating valu

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nick Craig-Wood schrieb: > Even if 0.0 is allocated and de-allocated 10,000 times in a row, there > would be no memory savings by caching its value. > > However there would be > a) less allocator overhead - allocation objects is relatively expensive > b) better caching of the value > c) less cache

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nick Maclaren schrieb: >> The total count of floating point numbers allocated at this point is 985794. >> Without the reuse, they would be 1317145, so this is a saving of 25%, and >> of 5Mb. > > And, if you optimised just 0.0, you would get 60% of that saving at > a small fraction of the cost and

[Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Fredrik Lundh
just noticed that the first google hit for "what's new in python 2.5": http://docs.python.org/dev/whatsnew/whatsnew25.html points to a document that's a weird mix between that actual document, and a placeholder for "what's new in python 2.6".

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > > >> The total count of floating point numbers allocated at this point is > >> 985794. > >> Without the reuse, they would be 1317145, so this is a saving of 25%, and > >> of 5Mb. > > > > And, if you optimised just 0.0, you w

[Python-Dev] 2.4.4 fixes

2006-10-03 Thread A.M. Kuchling
I've gone through the 'backport candidate' bugs listed on and applied most of them. Some I didn't apply because I don't understand them well enough to determine if they're correct for 2.4: * r47061 (recursionerror fix) * r46602 (tokeniz

Re: [Python-Dev] PEP 315 - do while

2006-10-03 Thread Nick Coghlan
Fuzzyman wrote: > Nick Coghlan wrote: >> In my example, the 3 sections (, and > completion >> code> are all optional. A basic do-while loop would look like this: >> >> do: >> >> while >> >> (That is, is still repeated each time around the loop - it's >> called that b

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nick Maclaren schrieb: > That was the point of a previous posting of mine in this thread :-( > > You shouldn't, despite what IEEE 754 says, at least if you are > allowing for either portability or numeric validation. > > There are a huge number of good reasons why IEEE 754 signed zeroes > fit ext

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Fred L. Drake, Jr.
On Tuesday 03 October 2006 08:56, Fredrik Lundh wrote: > just noticed that the first google hit for "what's new in python 2.5": > > http://docs.python.org/dev/whatsnew/whatsnew25.html > > points to a document that's a weird mix between that actual document, and > a placeholder for "what's

Re: [Python-Dev] PEP 315 - do while

2006-10-03 Thread Fuzzyman
Nick Coghlan wrote: > [snip..] > >> The current idiom works fine, but looks unnatural : >> >> while True: >> if : >>break > > > There's the rationale for the PEP in a whole 5 lines counting > whitespace ;) > >> Would a 'while' outside of a 'do' block (but without the colon) then be >>

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Nick Coghlan
Fredrik Lundh wrote: > just noticed that the first google hit for "what's new in python 2.5": > > http://docs.python.org/dev/whatsnew/whatsnew25.html > > points to a document that's a weird mix between that actual document, and > a placeholder for "what's new in python 2.6". D'oh. It's going

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread A.M. Kuchling
On Tue, Oct 03, 2006 at 02:56:54PM +0200, Fredrik Lundh wrote: > just noticed that the first google hit for "what's new in python 2.5": > > http://docs.python.org/dev/whatsnew/whatsnew25.html > > points to a document that's a weird mix between that actual document, and > a placeholder for "wh

Re: [Python-Dev] 2.4.4 fixes

2006-10-03 Thread A.M. Kuchling
On Tue, Oct 03, 2006 at 09:40:51AM -0400, A.M. Kuchling wrote: > The wiki page now lists all the revisions stemming from valgrind and > Klocwork errors. There are a lot of them; more volunteers will be > necessary if they're all to get looked at and possibly backported. I've now looked at the Val

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Fred L. Drake, Jr.
On Tuesday 03 October 2006 10:30, A.M. Kuchling wrote: > Neal, could you please delete all the temp files in whatever directory > is used to build the documentation? I wonder if there's a *.aux file > or something that still has labels from the 2.5 document. It might be > easiest to just dele

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > > Ah, you are proposing a semantic change, then: -0.0 will become > unrepresentable, right? Well, it is and it isn't. Python currently supports only some of IEEE 754, and that is more by accident than design - because that is

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nick Maclaren schrieb: > So distinguishing -0.0 from 0.0 isn't really in Python's current > semantics at all. And, for reasons that we could go into, I assert > that it should not be - which is NOT the same as not supporting > branch cuts in cmath. Are you talking about "Python the language speci

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nicko van Someren
On 3 Oct 2006, at 15:10, Martin v. Löwis wrote: > Nick Maclaren schrieb: >> That was the point of a previous posting of mine in this thread :-( >> >> You shouldn't, despite what IEEE 754 says, at least if you are >> allowing for either portability or numeric validation. >> >> There are a huge numb

Re: [Python-Dev] PSF Infrastructure Committee's recommendation for a new issue tracker

2006-10-03 Thread Aahz
If nothing else, Brett deserves a hearty round of applause for this work: Three cheers for Brett! -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "LL YR VWL R BLNG T S" -- www.nancybuttons.com ___ Python-Dev mailing list

Re: [Python-Dev] PSF Infrastructure Committee's recommendation for a new issue tracker

2006-10-03 Thread Paul Moore
On 10/3/06, Aahz <[EMAIL PROTECTED]> wrote: > If nothing else, Brett deserves a hearty round of applause for this work: > > Three cheers for Brett! Definitely. Paul ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread James Y Knight
On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote: > As Michael Hudson observed, this is difficult to implement, though: > You can't distinguish between -0.0 and +0.0 easily, yet you should. Of course you can. It's absolutely trivial. The only part that's even *the least bit* sketchy in this is

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nicko van Someren schrieb: > It's only a semantic change on platforms that "happen to" use IEEE > 754 float representations, or some other representation that exposes > the sign of zero. Right. Later, you admit that this is vast majority of modern machines. > It would be instructive to unders

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread skip
Martin> However, it is certainly a change to the observable behavior of Martin> the Python implementation, and no amount of arguing can change Martin> that. If C90 doesn't distinguish -0.0 and +0.0, how can Python? Can you give a simple example where the difference between the two is

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread skip
Martin> b) it is likely that this change won't affect a significant Martin>number of applications (I'm pretty sure someone will notice, Martin>though; someone always notices). +1 QOTF. Skip ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Scott David Daniels
James Y Knight wrote: > On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote: >> As Michael Hudson observed, this is difficult to implement, though: >> You can't distinguish between -0.0 and +0.0 easily, yet you should. > > Of course you can. It's absolutely trivial. The only part that's even > *th

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > If C90 doesn't distinguish -0.0 and +0.0, how can Python? Can you give a > simple example where the difference between the two is apparent to the > Python programmer? Sure: py> x=-0.0 py> y=0.0 py> x,y (-0.0, 0.0) py> hash(x),hash(y) (0, 0) py> x==y True py> str(x)==

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread A.M. Kuchling
On Tue, Oct 03, 2006 at 10:39:52AM -0400, Fred L. Drake, Jr. wrote: > and little or nothing about the cleanliness of the working area. The mkhowto > script should be cleaning out the old HTML before generating the new. I'm > guessing the deployment simply unpacks the new on top of the old; the

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Fred L. Drake, Jr.
On Tuesday 03 October 2006 14:08, A.M. Kuchling wrote: > That doesn't explain it, though; the contents of whatsnew26.html > contain references to pep-308.html. It's not simply a matter of new > files being untarred on top of old. Ah; I missed that the new HTML file was referring to an old head

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: > > py> x=-0.0 > py> y=0.0 > py> x,y Nobody is denying that SOME C90 implementations distinguish them, but it is no part of the standard - indeed, a C90 implementation is permitted to use ANY criterion for deciding when to displ

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread James Y Knight
On Oct 3, 2006, at 2:26 PM, Nick Maclaren wrote: > =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >> >> py> x=-0.0 >> py> y=0.0 >> py> x,y > > Nobody is denying that SOME C90 implementations distinguish them, > but it is no part of the standard - indeed, a C90 implementatio

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Nick Maclaren schrieb: >> py> x=-0.0 >> py> y=0.0 >> py> x,y > > Nobody is denying that SOME C90 implementations distinguish them, > but it is no part of the standard - indeed, a C90 implementation is > permitted to use ANY criterion for deciding when to display -0.0 and > 0.0. C99 is ambiguous t

Re: [Python-Dev] PEP 315 - do while

2006-10-03 Thread Ron Adam
Nick Coghlan wrote: > Fuzzyman wrote: >> Nick Coghlan wrote: >>> In my example, the 3 sections (, and >> completion >>> code> are all optional. A basic do-while loop would look like this: >>> >>> do: >>> >>> while >>> >>> (That is, is still repeated each time around t

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Gregory P. Smith
> > It would be instructive to understand how much, if any, python code > > would break if we lost -0.0. I'm do not believe that there is any > > reliable way for python code to tell the difference between all of > > the different types of IEEE 754 zeros and in the special case of -0.0 > >

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Alastair Houghton
On 3 Oct 2006, at 17:47, James Y Knight wrote: > On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote: >> As Michael Hudson observed, this is difficult to implement, though: >> You can't distinguish between -0.0 and +0.0 easily, yet you should. > > Of course you can. It's absolutely trivial. The only

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Josiah Carlson
Alastair Houghton <[EMAIL PROTECTED]> wrote: > On 3 Oct 2006, at 17:47, James Y Knight wrote: > > > On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote: > >> As Michael Hudson observed, this is difficult to implement, though: > >> You can't distinguish between -0.0 and +0.0 easily, yet you should.

[Python-Dev] 2.4.4 fix: Socketmodule Ctl-C patch

2006-10-03 Thread Tony Nelson
I've put a patch for 2.4.4 of the Socketmodule Ctl-C patch for 2.5, at the old closed bug . It passes "make EXTRAOPS-=unetwork test". Should I try to put this into the wiki at Python24Fixes? I haven't used the wiki before. -- __

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Steve Holden
Josiah Carlson wrote: [yet more on this topic] If the brainpower already expended on this issue were proportional to its significance then we'd be reading about it on CNN news. This thread has disappeared down a rat-hole, never to re-emerge with anything of significant benefit to users. C'mon,

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Guido van Rossum
On 10/3/06, Steve Holden <[EMAIL PROTECTED]> wrote: > If the brainpower already expended on this issue were proportional to > its significance then we'd be reading about it on CNN news. > > This thread has disappeared down a rat-hole, never to re-emerge with > anything of significant benefit to use

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Neal Norwitz
On 10/3/06, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > On Tuesday 03 October 2006 14:08, A.M. Kuchling wrote: > > That doesn't explain it, though; the contents of whatsnew26.html > > contain references to pep-308.html. It's not simply a matter of new > > files being untarred on top of old.

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Tim Peters
[EMAIL PROTECTED] > If C90 doesn't distinguish -0.0 and +0.0, how can Python? With liberal applications of piss & vinegar ;-) > Can you give a simple example where the difference between the two is apparent > to the Python programmer? Perhaps surprsingly, many (well, comparatively many, compared

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Tim Peters
[EMAIL PROTECTED] > Can you give a simple example where the difference between the two is apparent > to the Python programmer? BTW, I don't recall the details and don't care enough to reconstruct them, but when Python's front end was first changed to recognize "negative literals", it treated +0.0

Re: [Python-Dev] what's really new in python 2.5 ?

2006-10-03 Thread Fred L. Drake, Jr.
On Wednesday 04 October 2006 00:32, Neal Norwitz wrote: > I probably did not do that to begin with. I did rm -rf Doc && svn up > Doc && cd Doc && make. Let me know if there's anything else I should > do. I did this for both the 2.5 and 2.6 versions. That certainly sounds like it should be su

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Fred L. Drake, Jr.
On Wednesday 04 October 2006 00:53, Tim Peters wrote: > Someone (Fred, I think) introduced a front-end optimization to > collapse that to plain LOAD_CONST, doing the negation at compile time. I did the original change to make negative integers use just LOAD_CONST, but I don't think I changed wh

Re: [Python-Dev] Created branch for PEP 302 phase 2 work (in C)

2006-10-03 Thread Neal Norwitz
On 10/2/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > > This is why I asked for input from people on which would take less time. > Almost all the answers I got was that the the C code was delicate but that > it was workable. Several people said they wished for a Python > implementation, but hardly

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Tim Peters
[Tim] >> Someone (Fred, I think) introduced a front-end optimization to >> collapse that to plain LOAD_CONST, doing the negation at compile time. > I did the original change to make negative integers use just LOAD_CONST, but I > don't think I changed what was generated for float literals. That co

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Josiah Carlson
Steve Holden <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > [yet more on this topic] > > If the brainpower already expended on this issue were proportional to > its significance then we'd be reading about it on CNN news. Goodness, I wasn't aware that pointer manipulation took that much br

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Martin v. Löwis
Alastair Houghton schrieb: > On 3 Oct 2006, at 17:47, James Y Knight wrote: > >> On Oct 3, 2006, at 8:30 AM, Martin v. Löwis wrote: >>> As Michael Hudson observed, this is difficult to implement, though: >>> You can't distinguish between -0.0 and +0.0 easily, yet you should. >> >> Of course you ca

Re: [Python-Dev] [Python-checkins] r51862 - python/branches/release25-maint/Tools/msi/msi.py

2006-10-03 Thread Neal Norwitz
On 9/12/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > If you wonder how this all happened: Neal added sgml_input.html after > c1, but didn't edit msi.py to make it included on Windows. I found out > after running the test suite on the installed version, edited msi.py, > and rebuilt the insta

Re: [Python-Dev] [Python-checkins] r51862 - python/branches/release25-maint/Tools/msi/msi.py

2006-10-03 Thread Martin v. Löwis
Neal Norwitz schrieb: > Is there an easy to fix this sort of problem so it doesn't happen in > the future (other than revoke my checkin privileges :-) ? Sure: Don't make changes after a release candidate. That files are missing can only be detected by actually producing the installer and testing w