On Jan 19, 2008 3:06 PM, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote:

> In the Rational class that I've recently checked into Python 2.6
> (http://bugs.python.org/issue1682), it might be nice to provide a
> method that, given a particular rational number, returns a nearby
> number that's nicer in some way. I know of two reasonable behaviors
> [...]
> What does the list think?
>

I'm having trouble imagining a real use case for either of these methods.
 When I'm using Rational, it's almost certainly because I want exact
arithmetic;  if I'm getting results with huge denominators and numerators
then either that's what I really want, or I probably shouldn't have been
using Rational in the first place...

The only semi-use case I see is providing some way for users to turn the
float 1.1 into the rational 11/10, instead
of Rational(2476979795053773L,2251799813685248L).

So I'd say leave both these methods out for now---it would be easy enough to
add them later if it turns out there's a real need.

Just my 200/391 UK pennies :)

Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to