Thanks - re: Question re division

John Roth johnroth at ameritech.net
Mon Dec 30 07:38:05 EST 2002


"ahimsa" <ahimsa at onetel.net.uk> wrote in message
news:mailman.1041241416.12337.python-list at python.org...
> My thanks to the collective of Dan Bishop, Tim Peters, John Roth and
> Dennis Bieber for your replies to my question regarding division ( to
/
> or to // ) and I will upgrade my python release to the full 2.2. Also,
> thanks for the PEP link Dan.
> I guess then that the short answer to all of this is that whenever I'm
> doing something that will call for division, then err on the side of
> user distrust and import the futures module to handle whatever the
user
> inputs in a fail-safe way so that it is treated as a floating point
> regardless of how it is inputted. Did I get that straight? Only one
cup
> of coffee so far and my brain cells are having a duvet day!! :-)

It depends on what you are trying to accomplish. If you are clear
on exactly what you want out of each division operation, then you
won't get into trouble - unless you need backwards compatability
with 2.1 and earlier Python releases. The place people get into
trouble is not knowing whether they might possibly have two
integers as operands.

John Roth
>
> All the best for 2003 folks.
>
> AmF
>
>
>
> --
>
> ________________________%%%%%%%%%%%%%%%%%____________________________
>
> Proudly sent using Ximian Evolution 1.2.1 on a Linux Red Hat 8.0 box.
>
>





More information about the Python-list mailing list