Commit Graph

10 Commits

Author SHA1 Message Date
Eric Smith fa767efe06 Partially revert r60376: restore ability for ints to be automatically converted to floats, if a float type specifier is given to an int. PEP 3101 should be clarified on this point.Also, remove unused local variables left over from r60376. 2008-01-28 10:59:27 +00:00
Eric Smith 7b69c6c3af Restrict format presentation types to those specified in the 'Standard Format Specifiers' section of PEP 3101. 2008-01-27 21:07:59 +00:00
Christian Heimes 217cfd1c86 Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases in intobject.h 2007-12-02 14:31:20 +00:00
Eric Smith 37f10386f1 Changed to use 'U' argument to PyArg_ParseTuple, instead of manually checking for unicode objects. 2007-09-01 10:56:01 +00:00
Eric Smith 185e30cdf3 Added format tests.
Fixed bug in alignment of negative numbers.
Whitespace normalization.
2007-08-30 22:23:08 +00:00
Guido van Rossum 39342f4e65 Patch # 1048 by Amaury Forgeot d'Arc.
test_float crashes on Windows, because the %zd format is used in a call
to PyOS_snprintf().
The attached patch properly uses PY_FORMAT_SIZE_T.
2007-08-29 18:42:15 +00:00
Eric Smith 44300950dc Corrected missed #if in r57652. 2007-08-29 12:43:12 +00:00
Eric Smith b7f5ba16db Added conditional compilation for '()', which was an allowed sign code in a
previous version of PEP 3101.  It's currently not compiled in, but I want to
leave it because it might be useful in the future and it makes
calc_number_widths() clearer.  It justifies NumberFieldWidths.rsign
and .n__rsign.
2007-08-29 12:38:45 +00:00
Eric Smith 0cb431c071 Code layout changes for PEP 7 compliance. 2007-08-28 01:07:27 +00:00
Eric Smith 8c66326368 Implementation of PEP 3101, Advanced String Formatting.
Known issues:

The string.Formatter class, as discussed in the PEP, is incomplete.

Error handling needs to conform to the PEP.

Need to fix this warning that I introduced in Python/formatter_unicode.c:
Objects/stringlib/unicodedefs.h:26: warning: `STRINGLIB_CMP' defined but not used

Need to make sure sign formatting is correct, more tests needed.

Need to remove '()' sign formatting, left over from an earlier version of the PEP.
2007-08-25 02:26:07 +00:00