Skip to content

Commit c3c38f4

Browse files
committed
range format documentation
1 parent 0166f45 commit c3c38f4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

Diff for: doc/syntax.rst

+19-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,25 @@ Range Format Specifications
491491
Format specifications for range types have the following syntax:
492492

493493
.. productionlist:: sf
494-
range_format_spec: [":" [`underlying_spec`]]
494+
range_format_spec: [":" [`n`][`range_type`][`range_underlying_spec`]]
495+
496+
The `n` option causes the range to be formatted without the opening and closing brackets.
497+
498+
The available presentation types for `range_type` are:
499+
500+
+---------+----------------------------------------------------------+
501+
| Type | Meaning |
502+
+=========+==========================================================+
503+
| ``'s'`` | String format. The range is formatted as a string. |
504+
+---------+----------------------------------------------------------+
505+
| ``'?s'``| Debug format. The range is formatted as an escaped |
506+
| | string. |
507+
+---------+----------------------------------------------------------+
508+
| none | Default format. The range is formatted with a separator |
509+
| | |
510+
+---------+----------------------------------------------------------+
511+
512+
If `range_type` is `s` or `?s`, the underlying type of the range must be a char type.
495513

496514
The `underlying_spec` is parsed based on the formatter of the range's
497515
reference type.

0 commit comments

Comments
 (0)