Message68453
| 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:11 | amaury.forgeotdarc | set | spambayes_score: 0.00192646 -> 0.0019264605 recipients: + amaury.forgeotdarc, rhettinger, terry.reedy, belopolsky, pitrou, alexandre.vassalotti |
| 2008-06-20 11:50:10 | amaury.forgeotdarc | set | spambayes_score: 0.00192646 -> 0.00192646 messageid: <1213962610.9.0.275381619206.issue3008@psf.upfronthosting.co.za> |
| 2008-06-20 11:50:09 | amaury.forgeotdarc | link | issue3008 messages |
| 2008-06-20 11:50:09 | amaury.forgeotdarc | create | |