Comment on PEP-0238

Timothy Grant tjg at hyperlinq.net
Sat Jul 7 14:03:47 EDT 2001


On Sat, Jul 07, 2001 at 10:05:44AM -0700, Robert J. Harrison wrote:
> Guido van Rossum <guido at python.org> wrote in message news:<cpsngaja4g.fsf at cj20424-a.reston1.va.home.com>...
> 
> > The warning framework and the future statement are there to make the
> > transition easier.  Here's my plan, "new division in four phases":
> > 
> > 1. First we introduce a new function div() and a future statement that
> >    makes integer division return a float result for a specific module.

I've been watching this thread and the integer division PEP
with some dismay. I've only ever had cause to really use
integer division one time, and that was in a little module I
wrote several years ago that converted numbers such as
123456.78 into $123,456.78 and back again. It used a completely
ugly, and probably inefficient mechanism for doing so, but it
worked beautifully, and has been used in every GUI app I've
written that needs to display dollars-and-cents. I'm not the
most gifted programmer on the planet, but I have had no problem
with the concept of integer division, in fact, when I need a
calculator I usually open the Python interpreter and do my math
on the command line. I've never had a problem remembering that
if I want a float result I need to make one of the numbers a
float.

# It looks ugly but it really isn't. A couple of really nice
# Pythonisms
# make it work right. The first is list insertion, and the
# second is integer
# division.

I guess I need to revise the comments in my code now...

-- 
Stand Fast,
    tjg.

Timothy Grant                                www.hyperlinq.net 
Chief Technology Officer                     tjg at hyperlinq.net 
HyperLINq Technologies, Inc.                <>< (503) 246-3630
>>>>>>>>>>>>>Linux, because rebooting is *NOT* normal<<<<<<<<<
>>>>This machine was last rebooted:  32 days 17:55 hours ago<<




More information about the Python-list mailing list