MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / literal

Method literal

pymysql/connections.py:555–565  ·  view source on GitHub ↗

Alias for escape(). Non-standard, for internal use; do not use this in your applications.

(self, obj)

Source from the content-addressed store, hash-verified

553 return converters.escape_item(obj, self.encoding, mapping=mapping)
554
555 def literal(self, obj) -> str:
556 """Alias for escape().
557
558 Non-standard, for internal use; do not use this in your applications.
559 """
560 warnings.warn(
561 "literal() is deprecated and will be removed in the next version.",
562 DeprecationWarning,
563 stacklevel=2,
564 )
565 return self.escape(obj)
566
567 def _escape_string(self, s: str):
568 if self.server_status & SERVER_STATUS.SERVER_STATUS_NO_BACKSLASH_ESCAPES:

Callers

nothing calls this directly

Calls 1

escapeMethod · 0.95

Tested by

no test coverage detected