Every line of 'python string literals' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
36 def literal_compile(s): 37 """Compile a sql expression with bind params inlined as literals. 38 39 Parameters 40 ---------- 41 s : Selectable 42 The expression to compile. 43 44 Returns 45 ------- 46 cs : str 47 An equivalent sql string. 48 """ 49 return str(s.compile(compile_kwargs={'literal_binds': True}))
10 def test_string(self): 11 """Ensures strings are interpreted properly.""" 12 code = "'hi'" 13 lexed = self.lexer.parse_literal(code) 14 assert lexed == "['{string hi}']", "Issue in string tokenization."
220 @visitor(_ast.Str) 221 def visit_str(self, str): 222 return vbast.StringLiteral(str.s)