PyDocs

Nav

Text Processing Services

Interpolation

Interpolation object
Members of Interpolation

_

__new__
Create and return a new object.

c

conversion
Conversion

e

expression
Expression

f

format_spec
Format specifier

v

value
Value
1 Example
>>> from string.templatelib import Interpolation
>>> interpolation = t'{1. + 2.:.2f}'.interpolations[0]
>>> interpolation
Interpolation(3.0, '1. + 2.', None, '.2f')
>>> match interpolation:
...     case Interpolation(value, expression, conversion, format_spec):
...         print(value, expression, conversion, format_spec, sep=' | ')
...
3.0 | 1. + 2. | None | .2f
from the Python docs
See Also
No see-alsos for string.templatelib/Interpolation
0 Notes
No notes for Interpolation