|
|
Log in / Subscribe / Register

A literal string type for Python

A literal string type for Python

Posted Apr 14, 2022 8:39 UTC (Thu) by NRArnot (subscriber, #3033)
Parent article: A literal string type for Python

Django has something similar. When ordinary strings are rendered into an HTML template, the HTML special characters are escaped ("<" into "&lt;" etc.). The programmer can create "safe" strings (type Safestring) which behave like ordinary strings in most ways, but which do not get HTML-escaped. They remain safe until they are combined with ordinary strings by concatenation etc.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds