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 amaury.forgeotdarc
Recipients alexandre.vassalotti, amaury.forgeotdarc, belopolsky, pitrou, rhettinger, terry.reedy
Date 2008-06-20.11:50:08
SpamBayes Score 0.0019264605
Marked as misclassified No
Message-id <1213962610.9.0.275381619206.issue3008@psf.upfronthosting.co.za>
In-reply-to
Content
I don't like this modification of a PyString object:

+	n = PyString_GET_SIZE(conv);
+	conv_str = PyString_AS_STRING(conv);
+	/* Remove the trailing 'L' if present */
+	if (n && conv_str[n-1] == 'L')
+		conv_str[n-1] = '\0';
+	result = PyString_FromFormat("%s * 2.0 ** %d", conv_str, exp);

The string may have other references (ex: all single-char strings are
shared) and it seems unwise to directly modify the memory.

Also, tests should check if negative numbers have the same
representation as their absolute value (with the sign). It is not
obvious from the implementation, which uses floor().
History
Date User Action Args
2008-06-20 11:50:11amaury.forgeotdarcsetspambayes_score: 0.00192646 -> 0.0019264605
recipients: + amaury.forgeotdarc, rhettinger, terry.reedy, belopolsky, pitrou, alexandre.vassalotti
2008-06-20 11:50:10amaury.forgeotdarcsetspambayes_score: 0.00192646 -> 0.00192646
messageid: <1213962610.9.0.275381619206.issue3008@psf.upfronthosting.co.za>
2008-06-20 11:50:09amaury.forgeotdarclinkissue3008 messages
2008-06-20 11:50:09amaury.forgeotdarccreate