[Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

Georg Brandl g.brandl at gmx.net
Sun Dec 9 12:53:40 CET 2007


Terry Reedy schrieb:
> "Noam Raphael" <noamraph at gmail.com> wrote in message 
> news:b348a0850712090033r61577b83hc8d8a324705ef0f7 at mail.gmail.com...
> | My use case is data manipulation in the interactive shell -

You could always override sys.displayhook in order to handle floats
differently.

> It seems your real problem is that repr() rather than str() is applied 
> within collections.  (I am not sure exactly why but suspect there is a 
> reason.)

Consider ["1, 2, 3"].

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-3000 mailing list