Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2308)

Unified Diff: Python/sysmodule.c

Issue 33084: [issue1580] Use shorter float repr when possible (Closed) Base URL: http://svn.python.org/view/*checkout*/python/branches/py3k/
Patch Set: Include fallback code; fixed SSE2 detection Created 14 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Python/pystrtod.c ('k') | configure » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Python/sysmodule.c
===================================================================
--- Python/sysmodule.c (revision 71648)
+++ Python/sysmodule.c (working copy)
@@ -1025,6 +1025,7 @@
executable -- pathname of this Python interpreter\n\
prefix -- prefix used to find the Python library\n\
exec_prefix -- prefix used to find the machine-specific Python library\n\
+float_repr_style -- string indicating the style of repr() output for floats\n\
"
)
#ifdef MS_WINDOWS
@@ -1428,6 +1429,15 @@
FlagsType.tp_init = NULL;
FlagsType.tp_new = NULL;
+ /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
+#ifndef PY_NO_SHORT_FLOAT_REPR
+ SET_SYS_FROM_STRING("float_repr_style",
+ PyUnicode_FromString("short"));
+#else
+ SET_SYS_FROM_STRING("float_repr_style",
+ PyUnicode_FromString("legacy"));
+#endif
+
#undef SET_SYS_FROM_STRING
if (PyErr_Occurred())
return NULL;
« no previous file with comments | « Python/pystrtod.c ('k') | configure » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b