[Python-Dev] pyc files, constant folding and borderline portability issues

Terry Reedy tjreedy at udel.edu
Tue Apr 7 23:09:13 CEST 2009

Cesare Di Mauro wrote:
> On Tue, Apr 7, 2009 07:22PM, Guido van Rossum wrote:
>>> In my experience it's better to discover a bug at compile time rather
>>> than
>>> at running time.
>> That's my point though, which you seem to be ignoring: if the user
>> explicitly writes "1/0" it is not likely to be a bug. That's very
>> different than "1/x" where x happens to take on zero at runtime --
>> *that* is likely  bug, but a constant folder can't detect that (at
>> least not for Python).
>> --
>> --Guido van Rossum (home page: http://www.python.org/~guido/)
> I agree. My only concern was about user mistyping that can leed to an
> error interceptable by a stricter constant folder.
> But I admit that it's a rarer case compared to an explicit exception
> raising such the one you showed.

I would guess that it is so rare as to not be worth bothering about.

More information about the Python-Dev mailing list