[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

Mark Dickinson report at bugs.python.org
Mon Jan 7 03:21:47 CET 2008

Mark Dickinson added the comment:

Two more questions:  

(1) should a Rational instance be hashable?
(2) Should "Rational(5,2) == Decimal('2.5')" evaluate to True or False?

If Rationals are hashable and 2.5 == Rational(5, 2) == Decimal('2.5') then the 
rule that objects that compare equal should have equal hash is going to make 
life *very* interesting...

Tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list