[New-bugs-announce] [issue24549] string.format() should have a safe_substitute equivalent, to be run consecutively

azrdev report at bugs.python.org
Wed Jul 1 22:42:29 CEST 2015


New submission from azrdev:

"{1} {0}".format('one').format('two')

should return "two one", but throws

    IndexError: tuple index out of range


This would allow partial replacements, similar to string.Template.safe_substitute()
I suggest an analog construction (e.g. a method string.safe_format() )

----------
components: Library (Lib)
messages: 246047
nosy: azrdev
priority: normal
severity: normal
status: open
title: string.format() should have a safe_substitute equivalent, to be run consecutively
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24549>
_______________________________________


More information about the New-bugs-announce mailing list