Steven D'Aprano wrote: > But no such problems arise with comparisons, which will always return a > bool, and will avoid the current ... interesting ... behaviour. In 3.1: > >>>> Decimal(1) == 1 == 1.0 > True >>>> Decimal(1) == 1.0 > False >>>> Decimal.from_float(1.0) == 1 == 1.0 > True >>>> Decimal.from_float(1.0) == 1.0 > False > > Replacing False with an exception doesn't make it any less bizarre.
Allowing the comparisons also doesn't introduce the potential for large cumulative errors which are possible when actual implicit arithmetic conversions are allowed. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ 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