This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaredgrubb
Recipients alexandre.vassalotti, amaury.forgeotdarc, christian.heimes, eric.smith, gvanrossum, jaredgrubb, mark.dickinson, nascheme, noam, preston, rhettinger, tim.peters
Date 2009-04-07.18:32:25
SpamBayes Score 5.857549e-06
Marked as misclassified No
Message-id <>
I think ANY attempt to rely on eval(repr(x))==x is asking for trouble,
and it should probably be removed from the docs.

Example: The following C code can vary *even* on a IEEE 754 platform,
even in two places in the same source file (so same compile options),
even in the same 5 lines of code recompiled after changing code that
does even not touch/read 'x' or 'y':

double x, y;
x = 3.0/7.0;
y = x;
/* ... code that doesnt touch/read x or y ... */
printf(" x==y: %s", (x==y) ? "true" : "false");

So, how can we hope that eval(repr(x))==x is EVER stable? Equality and
floating point should raise the hairs on the back of everyone's neck...

(Code above based on in section
"Current IEEE 754 Implementations", along with a great explanation on
why this is true. The code example is a little different, but the same
concept applies.)
Date User Action Args
2009-04-07 18:32:28jaredgrubbsetrecipients: + jaredgrubb, gvanrossum, tim.peters, nascheme, rhettinger, amaury.forgeotdarc, mark.dickinson, eric.smith, christian.heimes, alexandre.vassalotti, noam, preston
2009-04-07 18:32:27jaredgrubbsetmessageid: <>
2009-04-07 18:32:26jaredgrubblinkissue1580 messages
2009-04-07 18:32:26jaredgrubbcreate