Skip to content

Commit 9a0a301

Browse files
committed
Wrap up lexical analysis updates... I think?
1 parent d043381 commit 9a0a301

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Doc/reference/lexical_analysis.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,11 +932,24 @@ the following differences:
932932

933933
- The :func:`format` protocol is not used. Instead, the format specifier and
934934
conversions (if any) are passed to a new :class:`~string.templatelib.Interpolation`
935-
object that is created for each evaluated expression.
935+
object that is created for each evaluated expression. It is up to code that
936+
processes the resulting :class:`~string.templatelib.Template` object to
937+
decide how to handle format specifiers and conversions.
936938

937939
- Format specifiers containing nested replacement fields are evaluated eagerly,
938940
prior to being passed to the :class:`~string.templatelib.Interpolation` object.
939941

942+
- When the equal sign ``'='`` is provided in an interpolation expression, the
943+
resulting :class:`~string.templatelib.Template` object will have the expression
944+
text along with a ``'='`` character placed in its
945+
:attr:`~string.templatelib.Template.strings` attribute. The
946+
:attr:`~string.templatelib.Template.interpolations` attribute will also
947+
contain an ``Interpolation`` instance for the expression. By default, the
948+
:attr:`~string.templatelib.Interpolation.conversion` attribute will be set to
949+
``'r'`` (i.e. :func:`repr`), unless there is a conversion explicitly specified
950+
(in which case it overrides the default) or a format specifier is provided (in
951+
which case, the ``conversion`` defaults to ``None``).
952+
940953

941954
.. _numbers:
942955

@@ -1069,7 +1082,7 @@ readability::
10691082

10701083
Either of these parts, but not both, can be empty. For example::
10711084

1072-
10. # (equivalent to 10.0)
1085+
1. # (equivalent to 10.0)
10731086
.001 # (equivalent to 0.001)
10741087

10751088
Optionally, the integer and fraction may be followed by an *exponent*:

0 commit comments

Comments
 (0)