A use for integer quotients
Joal Heagney
s713221 at student.gu.edu.au
Wed Jul 25 05:05:33 EDT 2001
Duncan Grisby wrote:
>
> In article <cpzo9veuml.fsf at cj20424-a.reston1.va.home.com>,
> Guido van Rossum <guido at python.org> wrote:
>
> >Of course, I'm well aware of the issues around maintaining old code.
> >We will have to carry around "from __future__ import division" for a
> >loooooong time. Python 2.2 is the first opportunity to introduce it,
> >so let's not be shy.
>
> What is the suggested course of action for people (like me) who have
> to maintain software which must run on more than one version of
> Python?
>
> Cheers,
>
> Duncan.
>
> --
> -- Duncan Grisby \ Research Engineer --
> -- AT&T Laboratories Cambridge --
> -- http://www.uk.research.att.com/~dpg1 --
Um. Probably to explicitly state what type of result you're expecting to
get back. Like the float(a)/b trick for a float return on present
python, and an int(a/b) for an integer on future (post 2.3+) versions of
python. *grins* As a moderate follower (yellow belt at best) it is a bit
bewildering watching all the changes that have suddenly sprung up.
But generators have got my vote!
--
Joal Heagney is: _____ _____
/\ _ __ __ _ | | _ ___ |
/__\|\ || ||__ |\ || |___|/_\|___] |
/ \ \_||__ ||___| \_|! | | \ \ !
More information about the Python-list
mailing list