Re: RFC on Arbitrary Literal Strings PEP
14 Jan
2022
14 Jan
'22
10:19 p.m.
Hi all, The motivation in the PEP mentions SQL and shell scripts, but logging may also be a potential use-case to mention. Logging does string formatting. So, if you feed it an arbitrary string, you can get into trouble: logger.info(f'look: {untrusted_string}', some_dict) # DANGER if untrusted_string = %(somekey)999999999s IMHO this seemed like a good place to make use of Literal[str]. I’ve opened a discussion at https://bugs.python.org/issue46200, and would be interested to hear some opinions from this crowd.
826
Age (days ago)
826
Last active (days ago)
0 comments
1 participants
participants (1)
-
Arie Bovenberg