def slot_code(self, scope): if scope.doc is not None: if scope.doc.is_unicode: doc = scope.doc.utf8encode() else: doc = scope.doc.byteencode() return '__Pyx_DOCSTR("%s")' % StringEncoding.escape_byte_string(doc) else: return "0"
def slot_code(self, scope): if scope.doc is not None: if scope.doc.is_unicode: doc = scope.doc.utf8encode() else: doc = scope.doc.byteencode() return '"%s"' % StringEncoding.escape_byte_string(doc) else: return "0"
def __init__(self, cname, text, byte_string): self.cname = cname self.text = text self.escaped_value = StringEncoding.escape_byte_string(byte_string) self.py_strings = None
def __init__(self, cname, text, byte_string): self.cname = cname self.text = text self.escaped_value = StringEncoding.escape_byte_string(byte_string) self.py_strings = None
def literal_code(self, value): assert isinstance(value, str) return '"%s"' % StringEncoding.escape_byte_string(value)
def literal_code(self, value): assert isinstance(value, str) return '"%s"' % StringEncoding.escape_byte_string(value)