A Revised Rational Proposal

Nick Coghlan ncoghlan at iinet.net.au
Mon Dec 27 06:46:58 EST 2004


Mike Meyer wrote:
> Yup. Thank you. This now reads:
> 
> Regarding str() and repr() behaviour, repr() will be either
> ''rational(num)'' if the denominator is one, or ''rational(num,
> denom)'' if the denominator is not one. str() will be either ''num''
> if the denominator is one, or ''(num / denom)'' if the denominator is
> not one.
> 
> Is that acceptable?

Sounds fine to me.

On the str() front, I was wondering if Rational("x / y") should be an acceptable 
string input format.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list