▲ | ratorx 9 days ago | ||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||
▲ | itishappy 9 days ago | parent [-] | ||||||||||||||||||||||||||||||||||
Oh, I'm pretty sure I didn't understand your example and am probably missing something obvious. That's why I'm here asking dumb questions! I think I'm following more, and I see how you can accomplish this by encapsulating the rendering, but I'm still not seeing how this is possible with user facing f-strings. Think you can write up a quick example? | |||||||||||||||||||||||||||||||||||
|