def literal(self, o):
if isinstance(o, unicode):<EOL><INDENT>s = self.string_literal(o.encode(self.encoding))<EOL><DEDENT>elif isinstance(o, bytearray):<EOL><INDENT>s = self._bytes_literal(o)<EOL><DEDENT>elif isinstance(o, bytes):<EOL><INDENT>if PY2:<EOL><INDENT>s = self.string_literal(o)<EOL><DEDENT>else:<EOL><INDENT>s = self._bytes_literal(o)<EOL><DEDENT><DEDENT>elif isinstance(o, (tuple, list)):<EOL><INDENT>s = self._tuple_literal(o)<EOL><DEDENT>else:<EOL><INDENT>s = self.escape(o, self.encoders)<EOL>if isinstance(s, unicode):<EOL><INDENT>s = s.encode(self.encoding)<EOL><DEDENT><DEDENT>assert isinstance(s, bytes)<EOL>return s<EOL>
If o is a single object, returns an SQL literal as a string.
        If o is a non-string sequence, the items of the sequence are
        converted and returned as a sequence.

        Non-standard. For internal use; do not use this in your
        applications.