On Tue, Jun 20, 2017 at 2:49 PM, Skip Montanaro <skip.montan...@gmail.com> wrote: > I'd not used the Decimal classes before, but some data I was receiving > from a database via pyodbc came that way. In writing some test cases, > I had a hard time making things work out. I eventually figure out what > was going on: > >>>> import decimal, cdecimal >>>> decimal.Decimal('2226.48') == cdecimal.Decimal('2226.48') > False > > (apologies for any typos, can't copy/paste) > > This seems odd to me. I'm currently unable to make the comparison in > my Python 3 env (Conda woes), but I have both decimal and cdecimal in > my Python 2.7 env. Shouldn't these beasts compare equal?
It seems like it, although I don't think they were ever intended to be used side-by-side. cdecimal isn't part of the standard library and is supposed to be a drop-in replacement. As of CPython 3.3, the decimal module *is* cdecimal. -- https://mail.python.org/mailman/listinfo/python-list