PEP 501: update for tagged strings (#3944)
* switch to lazy conversion specifier processing (includes adding `operator.convert_field`) * added proposal for `!()` as a new conversion specifier that invokes `__call__` (rather than `__repr__` or `__str__`) * add `render_text` callback to `TemplateLiteral.render` signature (default value: `str`) * new protocol: `typing.InterpolationTemplate` (protocol corresponding to the concrete `types.TemplateLiteral` type) * new protocol: `typing.TemplateText` (equivalent to `Decoded` from PEP 750) * new protocol: `typing.TemplateField` (inspired by `Interpolation` from PEP 750, with adjustments for eager field evaluation) * new concrete type: `types.TemplateLiteralText` (equivalent to `DecodedConcrete` from PEP 750) * new concrete type: `types.TemplateLiteralField` (inspired by `InterpolationConcrete` from PEP 750, with adjustments for eager field evaluation) * added iteration support to `TemplateLiteral`, producing `TemplateLiteralText` and `TemplateLiteralField` instances in their order of appearance (keeping the "no empty TemplateLiteralText entries" rule from PEP 750) * change the way `TemplateLiteral` works based on the way PEP 750 works * added or updated discussion notes about several included and deferred features Closes #3904
This commit is contained in:
parent
da41ded5e9
commit
147c58257f
1415
peps/pep-0501.rst
1415
peps/pep-0501.rst
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue