| ▲ | cloudbonsai 2 hours ago | |
> There is no caching of a "utf-8 representation". No there certainly is. This is documented in the official API documentation:
In particular, Python's Unicode object (PyUnicodeObject) contains a field named utf8. This field is populated when PyUnicode_AsUTF8AndSize() is first called and reused thereafter. You can check the exact code I'm talking about here:https://github.com/python/cpython/blob/main/Objects/unicodeo... Is it clear enough? | ||