diff options
Diffstat (limited to 'doc/syntax.rst')
-rw-r--r-- | doc/syntax.rst | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/syntax.rst b/doc/syntax.rst index 74b64c5a..3c21902c 100644 --- a/doc/syntax.rst +++ b/doc/syntax.rst @@ -82,7 +82,7 @@ The general form of a *standard format specifier* is: width: `integer` | "{" [`arg_id`] "}" precision: `integer` | "{" [`arg_id`] "}" type: "a" | "A" | "b" | "B" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | - : "o" | "p" | "s" | "x" | "X" + : "o" | "p" | "s" | "x" | "X" | "?" The *fill* character can be any Unicode code point other than ``'{'`` or ``'}'``. The presence of a fill character is signaled by the character following @@ -177,6 +177,9 @@ The available string presentation types are: | ``'s'`` | String format. This is the default type for strings and | | | may be omitted. | +---------+----------------------------------------------------------+ +| ``'?'`` | Debug format. The string is quoted and special | +| | characters escaped. | ++---------+----------------------------------------------------------+ | none | The same as ``'s'``. | +---------+----------------------------------------------------------+ @@ -188,6 +191,9 @@ The available character presentation types are: | ``'c'`` | Character format. This is the default type for | | | characters and may be omitted. | +---------+----------------------------------------------------------+ +| ``'?'`` | Debug format. The character is quoted and special | +| | characters escaped. | ++---------+----------------------------------------------------------+ | none | The same as ``'c'``. | +---------+----------------------------------------------------------+ @@ -223,9 +229,10 @@ The available integer presentation types are: | none | The same as ``'d'``. | +---------+----------------------------------------------------------+ -Integer presentation types can also be used with character and Boolean values. -Boolean values are formatted using textual representation, either ``true`` or -``false``, if the presentation type is not specified. +Integer presentation types can also be used with character and Boolean values +with the only exception that ``'c'`` cannot be used with `bool`. Boolean values +are formatted using textual representation, either ``true`` or ``false``, if the +presentation type is not specified. The available presentation types for floating-point values are: |