[Python-Dev] Floor division

Jim Jewett jimjjewett at gmail.com
Tue Jan 23 18:05:05 CET 2007


Nick Maclaren wrote:
>... I can work with and teach almost any model,
> and have done so with some pretty weird ones.

I think python's model is "Whatever your other tools use.  Ask them."
And I think that is a reasonable choice.

For sensible input, the various models all work the same.

For dubious input, you get the same answer as you got from some other
tool, so you can automate some of your regression testing.

>... Python doesn't support any libm
>behaviour other than the one that it was compiled with, and that is
>often NOT what is wanted.

If you care (and know) enough to want a specific behavior on dubious
output, then you know more about your specfic problem then python ever
could.  If you can go on to say "and this platform libm is wrong, but
the other one over there is right", then you can probably recompile.

> Some people write Python that is intended to be robust and portable;
> it is those people who suffer.

If your users stick to sensible inputs, then it doesn't matter which
model you used.

If not, there is no way to get robust and portable; it is just a
matter of which users you annoy.

I could understand "throw an error, and *make* them choose a model if
they want to process bad data", but that isn't really any easier to
for a user to fix than the current non-model.

-jJ


More information about the Python-Dev mailing list