number-sig anyone?
Dev-ers, I have been guilty of generating as much heat as light the past few days on the subject of integer division (though not quite as much heat as Stephen Horne!). For that I apologize. There are several active PEPs related to various aspects of Python's concept of numbers. Yesterday I found these: S 211 pep-0211.txt Adding A New Outer Product Operator Wilson S 228 pep-0228.txt Reworking Python's Numeric Model Zadka S 237 pep-0237.txt Unifying Long Integers and Integers Zadka S 238 pep-0238.txt Non-integer Division Zadka S 239 pep-0239.txt Adding a Rational Type to Python Zadka S 240 pep-0240.txt Adding a Rational Literal to Python Zadka S 242 pep-0242.txt Numeric Kinds Dubois Today I took a look at http://mail.python.org/mailman/listinfo and could find no math-sig or number-sig mailing list. If Python's number system is going to change in one or more backwards-incompatible I think there may only be one chance to get it right. I think a number-sig mailing list would be a worthwhile forum to discuss these issues. If there's already a group specific to this topic I missed it. Point me and I will start reading archives. Skip
Skip Montanaro writes:
Today I took a look at http://mail.python.org/mailman/listinfo and could find no math-sig or number-sig mailing list. If Python's number system is going to change in one or more backwards-incompatible I think there may only be one chance to get it right. I think a number-sig mailing list would be a worthwhile forum to discuss these issues.
There is the python-numerics mailing list on SourceForge; find it from the Python project page there: http://sourceforge.net/projects/python/ -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
Fred> There is the python-numerics mailing list on SourceForge; find it Fred> from the Python project page there: Fred> http://sourceforge.net/projects/python/ I don't suppose there's any chance those three sourceforge-hosted mailing lists could be mentioned on mail.python.org, could they? Seems to me that those three mailing lists are sponsored by the same organization as those hosted on mail.python.org. Skip
Fred> There is the python-numerics mailing list on SourceForge; find it Fred> from the Python project page there:
Fred> http://sourceforge.net/projects/python/
I don't suppose there's any chance those three sourceforge-hosted mailing lists could be mentioned on mail.python.org, could they? Seems to me that those three mailing lists are sponsored by the same organization as those hosted on mail.python.org.
I think they should be mentioned there. Fred, can you edit the MailingLists.ht file? --Guido van Rossum (home page: http://www.python.org/~guido/)
Skip Montanaro writes:
I don't suppose there's any chance those three sourceforge-hosted mailing lists could be mentioned on mail.python.org, could they? Seems to me that those three mailing lists are sponsored by the same organization as those hosted on mail.python.org.
I don't know any way to do that. If we could more easily create new lists on python.org (i.e., not have to wait for Barry), they never would have been created on SourceForge. Guido van Rossum writes:
I think they should be mentioned there. Fred, can you edit the MailingLists.ht file?
Done. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
"Fred" == Fred L Drake, Jr
writes:
Fred> I don't know any way to do that. If we could more easily Fred> create new lists on python.org (i.e., not have to wait for Fred> Barry), they never would have been created on SourceForge. Actually, creating the lists is no problem, takes just seconds. It's updating the sigs page that's the PITA. Note that in Mailman 2.1, you'll be able to create new lists thru-the-web, and we can delegate that responsibility to a "list creator" password which can be shared by a small group of trusted folks. Updating the sigs page is still a separate process. -Barry
Damn... Are the archives of the python-numeric list available somewhere as a single mbox file or something? Looks like geocrawler is going to make me wade through the archives message-by-message on their website. Skip
"Fred" == Fred L Drake, Jr
writes:
Fred> There is the python-numerics mailing list on SourceForge; Fred> find it from the Python project page there: Fred> http://sourceforge.net/projects/python/ Ah. Shouldn't this page http://www.python.org/sigs/ point to this page http://sourceforge.net/mail/?group_id=5470 ??? -Barry
Fred> There is the python-numerics mailing list on SourceForge; find it Fred> from the Python project page there: Fred> http://sourceforge.net/projects/python/ BAW> Ah. Shouldn't this page BAW> http://www.python.org/sigs/ BAW> point to this page BAW> http://sourceforge.net/mail/?group_id=5470 BAW> ??? Looks like we have at least three pages that list related info: http://www.python.org/sigs/ http://mail.python.org/ http://sourceforge.net/mail/?group_id=5470 Can they be unified? Skip
Looks like we have at least three pages that list related info:
http://www.python.org/sigs/ http://mail.python.org/ http://sourceforge.net/mail/?group_id=5470
Can they be unified?
I don't see how. --Guido van Rossum (home page: http://www.python.org/~guido/)
>> Looks like we have at least three pages that list related info: >> >> http://www.python.org/sigs/ >> http://mail.python.org/ >> http://sourceforge.net/mail/?group_id=5470 >> >> Can they be unified? Guido> I don't see how. Perhaps they can at least be made to point incestuously to one another (though I imagine the sf page is completely out of our control and thus immune to such incest)... Skip
>> Looks like we have at least three pages that list related info: >> >> http://www.python.org/sigs/ >> http://mail.python.org/ >> http://sourceforge.net/mail/?group_id=5470 >> >> Can they be unified?
Guido> I don't see how.
Perhaps they can at least be made to point incestuously to one another (though I imagine the sf page is completely out of our control and thus immune to such incest)...
Skip
And the mailman page is also auto-generated. This leaves the sigs page, which AFAIK already points to the others (incestuously or otherwise :-). --Guido van Rossum (home page: http://www.python.org/~guido/)
"SM" == Skip Montanaro
writes:
>> Looks like we have at least three pages that list related info: >> http://www.python.org/sigs/ http://mail.python.org/ >> http://sourceforge.net/mail/?group_id=5470 Can they be unified? Guido> I don't see how. SM> Perhaps they can at least be made to point incestuously to one SM> another (though I imagine the sf page is completely out of our SM> control and thus immune to such incest)... Only the /sigs/ page is statically generated, so only it is easy to change. -Barry
"SM" == Skip Montanaro
writes:
SM> Today I took a look at http://mail.python.org/mailman/listinfo SM> and could find no math-sig or number-sig mailing list. If SM> Python's number system is going to change in one or more SM> backwards-incompatible I think there may only be one chance to SM> get it right. I think a number-sig mailing list would be a SM> worthwhile forum to discuss these issues. +1. If others agree, I'll create the sig. -Barry
"SM" == Skip Montanaro
writes: SM> Today I took a look at http://mail.python.org/mailman/listinfo SM> and could find no math-sig or number-sig mailing list. If SM> Python's number system is going to change in one or more SM> backwards-incompatible I think there may only be one chance to SM> get it right. I think a number-sig mailing list would be a SM> worthwhile forum to discuss these issues.
+1. If others agree, I'll create the sig.
-Barry
Sounds like a good plan, but please wait until we have a SIG owner/moderator and a charter. Without both of these a SIG will be a failure. --Guido van Rossum (home page: http://www.python.org/~guido/)
On Tue, 24 Jul 2001 17:30:52 -0400, Guido van Rossum
Sounds like a good plan, but please wait until we have a SIG owner/moderator and a charter. Without both of these a SIG will be a failure.
If we do have a number-sig, I suppose python-numberics@sf.net should die and merge into that, right? I am all for that, but I won't be volunteering to be the champion... I've learned my lesson about spreading myself too thin. -- gpg --keyserver keyserver.pgp.com --recv-keys 46D01BD6 54C4E1FE Secure (inaccessible): 4BD1 7705 EEC0 260A 7F21 4817 C7FC A636 46D0 1BD6 Insecure (accessible): C5A5 A8FA CA39 AB03 10B8 F116 1713 1BCF 54C4 E1FE Learn Python! http://www.ibiblio.org/obp/thinkCSpy
Skip Montanaro wrote:
Dev-ers,
...
Today I took a look at http://mail.python.org/mailman/listinfo and could find no math-sig or number-sig mailing list. If Python's number system is going to change in one or more backwards-incompatible I think there may only be one chance to get it right.
That implies there is a "right". There isn't. There are just a bunch of opinions. And I can't imagine that a SIG would lead to a convergence of opinions because people come from such radically different backgrounds. I would rather see a rational-sig, float-division-sig, decimal-sig and so forth. Each could come up with a "locally coherent" plan and Guido could pick and choose. Otherwise it is might as well be called numeric-flame-flame-flame-sig. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook
Skip> Today I took a look at http://mail.python.org/mailman/listinfo and Skip> could find no math-sig or number-sig mailing list. If Python's Skip> number system is going to change in one or more backwards- Skip> incompatible [ways] I think there may only be one chance to get it Skip> right. Paul> That implies there is a "right". There isn't. There are just a Paul> bunch of opinions. And I can't imagine that a SIG would lead to a Paul> convergence of opinions because people come from such radically Paul> different backgrounds. I would rather see a rational-sig, Paul> float-division-sig, decimal-sig and so forth. Each could come up Paul> with a "locally coherent" plan and Guido could pick and choose. Paul, My operational definition of "right" in this context is perhaps different than yours. I realize there is no obviously right numeric model. If there was, most programming languages would use it and we wouldn't need bots like Tim to help guide us through minefields like IEEE 754. By "right" I mean that we can arrive at a long-term stable numeric model that will be accepted by both the Python community as a whole *and* by the decision makers who will vote thumbs up or down on adopting Python in their organizations. One of the most vocal opponents to PEP 238 (I won't mention his name, but his initials are S.H. ;-) lamented loudly that he'd be a laughing stock in his company because of that "division thing". He mentioned something about being a "right arse" I think. By having a well-considered overall plan for Python's numeric behavior, if you have to make an incompatible change today, another next year and a third two years after that, you can point to the plan that shows people where you're headed, how you plan to get there, and how they can write their programs in the meantime so as to be as resilient as possible. Without such a plan -- or with several potentially competing plans as you proposed -- every change proposed or made will simply fuel the fires of those people who dismiss Python because "it's unstable". The funny thing is, Python's semantics changed so little for so long that by comparison the rate of change does seem pretty high, but it's still much better than many applications or application libraries (such as the relatively recent glibc upheaval or the API changes Gtk is undergoing now). And let's not even mention the folks in Redmond... Skip
Briefly: [Skip Montanaro]
... I realize there is no obviously right numeric model.
There are many that are reasonable, though -- and that's the other half of the problem.
If there was, most programming languages would use it and we wouldn't need bots like Tim to help guide us through minefields like IEEE 754.
You've never seen a language that supports 754 properly (== as the committee intended). Certainly not Python, C or Java. It's far less a minefield when properly supported, and was designed to be much saner than previous binary f.p. systems. One problem is that languages only support the *corner* of 754 that intersects with 1950's Fortran; the other is that very few chips other than Pentium support the 754 80-bit extended format that's key to making binary f.p. much safer for non-experts. OTOH, the "proper 754 support" in the C99 Annex is a minefield of its own.
By "right" I mean that we can arrive at a long-term stable numeric model that will be accepted by both the Python community as a whole *and* by the decision makers who will vote thumbs up or down on adopting Python in their organizations.
The danger I see here is that Scheme's "numeric tower" is almost obviously a reasonable numeric model, but in practice is so vague that you can't really count on anything beyond simple small-int arithmetic working the same way across Scheme implementations. Guido appears to have come to an appreciation of that model in the abstract, but hoping that there's not much difference between floats and rationals in practice "because they represent the same mathematical values" just isn't going to pan out (IMO). 1/49*49 equals 1 or it doesn't; it doesn't using IEEE doubles, it does using rationals, and the difference will be significant to programs. Certainly better to switch from floats to rationals someday than to move in the other direction, though. I've come to suspect the issues *may& be complicated <wink>.
The danger I see here is that Scheme's "numeric tower" is almost obviously a reasonable numeric model, but in practice is so vague that you can't really count on anything beyond simple small-int arithmetic working the same way across Scheme implementations.
I certainly expect that we'll be able to do better than Scheme in our cross-implementation semantics -- Scheme is infamous for this.
Guido appears to have come to an appreciation of that model in the abstract, but hoping that there's not much difference between floats and rationals in practice "because they represent the same mathematical values" just isn't going to pan out (IMO). 1/49*49 equals 1 or it doesn't; it doesn't using IEEE doubles, it does using rationals, and the difference will be significant to programs. Certainly better to switch from floats to rationals someday than to move in the other direction, though.
Indeed, my only assumption is that switching from floats to rationals shouldn't be very disruptive. In my ideal numeric model, rationals auto-convert to floats but not the other way around, and str() and repr() of rationals would yield a decimal floating point representation similar to that of floats. (This is more or less what ABC did, except that for floats it added an annoying "~" as inexactness indicator.) To get a rational to print as x/y, you'd have to extract the numerator and denominator explicitly, or use some standard method.
I've come to suspect the issues *may& be complicated <wink>.
Sure. --Guido van Rossum (home page: http://www.python.org/~guido/)
By "right" I mean that we can arrive at a long-term stable numeric model that will be accepted by both the Python community as a whole *and* by the decision makers who will vote thumbs up or down on adopting Python in their organizations. One of the most vocal opponents to PEP 238 (I won't mention his name, but his initials are S.H. ;-) lamented loudly that he'd be a laughing stock in his company because of that "division thing". He mentioned something about being a "right arse" I think.
I'm not so worried. While many of the opponents tried to explain their position by arguing that int division was "right", their real worry was backwards compatibility. PEP 238 represents the *only* serious backwards incompatibility in the transition to a new numeric model that I can imagine. The transition plan that I hope to be checking into PEP 238 deals with the fears of the opponents by putting the sea change off until Python 3.0.
By having a well-considered overall plan for Python's numeric behavior, if you have to make an incompatible change today, another next year and a third two years after that, you can point to the plan that shows people where you're headed, how you plan to get there, and how they can write their programs in the meantime so as to be as resilient as possible. Without such a plan -- or with several potentially competing plans as you proposed -- every change proposed or made will simply fuel the fires of those people who dismiss Python because "it's unstable". The funny thing is, Python's semantics changed so little for so long that by comparison the rate of change does seem pretty high, but it's still much better than many applications or application libraries (such as the relatively recent glibc upheaval or the API changes Gtk is undergoing now). And let's not even mention the folks in Redmond...
Any additional serious incompatibilities will also be put off till Python 3.0. But I repeat, I don't expect any. Let me review: Int/long unification: - This "breaks" code that counts on the OverflowError. - This changes the meaning of left shift (the only operation that silently throws away bits rather than raising OverflowError). - This changes the meaning of octal and hex constants that set the sign bit in short integers -- 0xffffffff is currently a fancy way of writing -1 on a 32-bit machine, but after unification it will be the same as 0xffffffffL (i.e., 2**32-1). None of these is a big deal I think. Rationals: - The introduction of a new rational type in itself doesn't break anything. - Making 1/2 return a rational instead of a float could break some things but not at the scale of PEP 238. - Making 0.5 be a rational instead of a float will break more; we'll have to discuss this. I should note that the inclusion of rationals in the new numeric model is far from certain. There are potential problems with rationals that may require them to remain a separate type forever. This is about the extent of the changes to the numeric model that I'm contemplating; I don't think that the new numeric model should change much else. (I don't care much for some of the details of PEP 228, but I have to think more about it.) In other words, while the plan isn't spelled out yet, the only disruption is PEP 238. --Guido van Rossum (home page: http://www.python.org/~guido/)
Skip Montanaro wrote:
...
By "right" I mean that we can arrive at a long-term stable numeric model that will be accepted by both the Python community as a whole *and* by the decision makers who will vote thumbs up or down on adopting Python in their organizations.
But I don't think that there is any numeric model that will be accepted by the whole Python community. Some will like any change and some will dislike it. Likely there will appear to be equal numbers on either side of any issue because each flame is answered by one or more counter-flames.
... By having a well-considered overall plan for Python's numeric behavior, if you have to make an incompatible change today, another next year and a third two years after that, you can point to the plan that shows people where you're headed, how you plan to get there, and how they can write their programs in the meantime so as to be as resilient as possible.
I'm not a against such a plan but I don't think it can be designed in a committee. It would be largely the vision of one or two like-minded people with the same weighting of factors such as performance, ease of use, backwards compatibility and so forth. If you put an representation-obsessed engineer in the same committee with a purity-obsessed mathematician you'll find that the only thing they can agree on is to disagree. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook
participants (8)
-
barry@zope.com
-
Fred L. Drake, Jr.
-
Guido van Rossum
-
Guido van Rossum
-
m@moshez.org
-
Paul Prescod
-
Skip Montanaro
-
Tim Peters