| ▲ | itishappy 6 months ago | |||||||||||||||||||||||||||||||||||||||||||
I don't see how this prevents calling your returned f-string with unsensitized inputs. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | ratorx 6 months ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
I’m not sure you understood my example. The f-string is within a function. The function argument only accepts sanitised input type. If you create a subclass of str which has an init function that sanitises, then you can’t create a Sanitised type by casting right? And even if you could, there is also nothing stopping you from using a different function to “html” that just returns the string without sanitising. They are on the same relative level of safety. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||