MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / escape

Method escape

pymysql/connections.py:530–542  ·  view source on GitHub ↗

Escape whatever value is passed. Non-standard, for internal use; do not use this in your applications.

(self, obj, mapping=None)

Source from the content-addressed store, hash-verified

528 self._read_ok_packet()
529
530 def escape(self, obj, mapping=None):
531 """Escape whatever value is passed.
532
533 Non-standard, for internal use; do not use this in your applications.
534 """
535 if isinstance(obj, str):
536 return "'" + self.escape_string(obj) + "'"
537 if isinstance(obj, (bytes, bytearray)):
538 ret = self._quote_bytes(obj)
539 if self._binary_prefix:
540 ret = "_binary" + ret
541 return ret
542 return converters.escape_item(obj, self.charset, mapping=mapping)
543
544 def literal(self, obj):
545 """Alias for escape().

Callers 10

_send_autocommit_modeMethod · 0.95
literalMethod · 0.95
_escape_argsMethod · 0.80
callprocMethod · 0.80
test_escape_stringMethod · 0.80
test_escape_list_itemMethod · 0.80

Calls 2

escape_stringMethod · 0.95
_quote_bytesMethod · 0.95