[Python-Dev] shouldn't we be considering all pending numeric
proposals together?
M.-A. Lemburg
mal@lemburg.com
Wed, 25 Jul 2001 11:42:06 +0200
Tim Peters wrote:
>
> [MAL]
> > May I suggest that these rather controversial changes be carried
> > out on a separate branch of the Python source tree before adding
> > them to the trunk ?!
>
> Sure, provided you're volunteering to keep the branch in synch with the
> trunk: branches are both expensive and risky, unless the intent is never to
> merge in either direction.
As you may have guessed: I'm not particulary interested in any
change to the status quo w/r to Python's treatment of integer
division, since I know that I have used the current C-like
behaviour in code I've written in the past few years and that
finding this code will be a nightmare.
PEP 238 doesn't help with this either since it still changes
the semantics of '/' instead of keeping them and adding the
new semantics using a new operator '//' which wouldn't break
anything and still make people happy.
Also, I think that the warning framework will not help much for
moving to PEP 238: if you generate a warning for every source
code occurrance of '/' where integer division takes place, this
will render at least some programs unusable: either due to the
slow-down of having to branch through the warning machinery only
to find that the user doesn't want to see the warning or by
producing stderr messages in quantities which will keep any user
out there from using the program.
OTOH, I wouldn't mind if we add a per-module directive which then
tells the compiler to generate new style semantics integer
division opcodes. Guido's patch already implements this, except
that it uses the magic __future__ import which will be phased
out eventually... how about a "from __semantics__ import
non_integer_division" which does not have a timeout attached
to it ?!
> Much as I hate the obfuscating effects of #ifdefs, these changes are
> localized enough that it would be a clear net win to use them rather than
> branches, if Guido gets weary of maintaining a patch.
If that's feasable, sure...
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/