Alias for escape(). Non-standard, for internal use; do not use this in your applications.
(self, obj)
| 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: |