[issue39842] partial_format()

Marco Sulla report at bugs.python.org
Wed Mar 4 15:43:09 EST 2020


Marco Sulla <launchpad.net at marco.sulla.e4ward.com> added the comment:

> What would "{} {}".partial_format({}) return?
`str.partial_format()` was proposed exactly to avoid such tricks.

> It is not possible to implement a "safe" variant of str.format(),
> because in difference to Template it can call arbitrary code

If you read the documentation of `Template.safe_substitute()`, you can read also this function is not safe at all.

But Python, for example, does not implement private class attributes. Because Python is for adult and consciousness people, no?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39842>
_______________________________________


More information about the Python-bugs-list mailing list