Format a template string partially. Examples -------- >>> pformat("{a}_{b}", a='x') 'x_{b}'
(temp, **fmt)
| 81 | |
| 82 | |
| 83 | def pformat(temp, **fmt): |
| 84 | """Format a template string partially. |
| 85 | |
| 86 | Examples |
| 87 | -------- |
| 88 | >>> pformat("{a}_{b}", a='x') |
| 89 | 'x_{b}' |
| 90 | """ |
| 91 | formatter = Formatter() |
| 92 | mapping = _FormatDict(fmt) |
| 93 | return formatter.vformat(temp, (), mapping) |
| 94 | |
| 95 | |
| 96 | def _enqueue_output(out, queue): |
no test coverage detected