Ben Kehoe <b...@kehoe.io> added the comment: The point is to be able to programmatically determine what is needed for a successful substitute() call. A basic use case for this is better error messages; calling substitute() with an incomplete mapping will tell you only the first missing identifier it encounters; if you know all the identifiers you can raise an error about all the missing identifiers. Another error handling use case is checking whether the template is valid, without needing to provide a complete mapping. A use case unrelated to error handling that I’ve encountered a few times is interactive prompting for template values, which you can only do if you can get a list of the identifiers in the template.
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46307> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com