Future division patch available (PEP 238)

Guido van Rossum guido at python.org
Tue Jul 24 21:40:06 CEST 2001


paul at boddie.net (Paul Boddie) writes:

> But over a few releases, which seem to be quite frequent these days,
> one may find oneself with quite a collection of "legacy" programs
> which can't be guaranteed to run correctly under the most recent
> releases. The typical advice in such cases is for people not to
> upgrade, with the unfortunate result that certain users are likely to
> find themselves stranded on increasingly neglected releases of Python;
> particularly as module developers start to rely on newly introduced
> features.

I think it will be inevitable for many Pythons to come to provide a
way to turn off the new division rules.  I am currently working on a
command line option for this.

> In changing the semantics of the / operator, however, *everyone* is
> made to feel insecure. And grep "/" `find . -name "*.py"` (or
> whatever), unlike the suitability of such an approach in the case of
> "connect", is hardly going to help. Several people are talking about
> clever tools: perhaps once they are written, the authors will then
> give us the type inferencing system people have been wanting for so
> long. <1/2 wink>

That's not a bad idea.  Maybe the race for the best division upgrade
tool will have practical type inference as a side effect.
Traditionally, "mostly correct" type inference has been rejected as
too dangerous; but in a conversion tool, it would be much better than
nothing.

Maybe PyChecker's engine might be up to the challenge; it already
seems to attempt some type inference, for example in its warnings
about inconsistent return values.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list