picop.cyunicode#

Fast str UTF-8 and intern helpers.

picop.cyunicode.uintern(s)#

Intern s via PyUnicode_InternInPlace and return the canonical instance. :type s: str :param s:

Return type:

str

picop.cyunicode.unicode_eq(a, b)#

Return True if a == b.

Notes

Thin alias of str_eq with the same semantics; prefer str_eq from picop.cystr on value-op hot paths.

Parameters:
Return type:

bool

picop.cyunicode.uutf8_bytes(s)#

Return owning UTF-8 bytes for s via PyUnicode_AsUTF8String.

Notes

Owning copy — safe to keep past the lifetime of s. Prefer this over borrowed uutf8 (cimport-only) when you need a durable value.

Parameters:

s (str)

Return type:

bytes