--- a/python.rst Mon Sep 15 20:51:13 2014 +0900
+++ b/python.rst Mon Sep 15 20:51:49 2014 +0900
-.. %, mapping, conversion, min width, precision, length, type
-``%[(<name>)]`` *|* ``[#0- +][<min width 0-9*>][.<0-9*>][<length>]dioxXeEfFgGcrs``
- the value conversion will use the “alternate form” (where defined below)
- the conversion will be zero padded for numeric values
+Common Format Presentation
+--------------------------
- the converted value is left adjusted (overrides the '0' conversion if both
- (a space) a blank should be left before a positive number (or empty string)
- produced by a signed conversion
- a sign character ('+' or '-') will precede the conversion (overrides a
floating point decimal format
- floating point format. Uses *lowercase*, *uppercase* exponential format if
- exponent is less than -4 or not less than precision, decimal format
+ floating point format, decimal or *lowercase*, *uppercase* exponential
single character (accepts integer or single character string)
+Format Presentation for %
+-------------------------
- string (converts any Python object using repr())
+ same as ``s``, but converts any object using ``repr()``
+Format Presentation for .format()
+---------------------------------
+ ``d`` or ``g`` with locale-specific characters
+ percentage, like ``f``, but multiplies the number by 100 and adds a percent
+Formatting with .format()
+-------------------------
- string (converts any Python object using str())
+``"{"[field_name]["!"conversion][":"format_spec]"}"``
+format_spec: ``[[fill]align][sign]["#"]["0"][width][","]["."precision][type]``
+ align to left (default for most objects)
+ align to right (default for numbers)
+ padding between sign and digits (``+000000120``, valid only for numbers)
+ (a space) ``␣5`` ``-5``
+ sign-aware zero-padding for numeric types (like ``{:0=}``)
+ comma as thousands sparator (l10n: use ``n``)