News for hackers. Stuff that matters.
Re:Python to get Google-backed speedup by dfsdfsdsfdsf on Sunday June 14, 2009 @04:45PM (#657529)
More likely: s = "something < other" s = s.replace("<", "&lt;") Even more likely: import cgi s = cgi.escape(s)

In Python, much string manipulation is done with builtins (especially string methods) and library functions. The latter work especially well when you target a specific domain (such as HTML) and will often be implemented in regexps. Writing one's own regexps are for when you actually need a small custom state machine. Many problems are too small or too large to justify the effort.

There are no comments on this comment yet.