[Python-Dev] [Python-checkins] r88709 - in python/branches/py3k: Misc/NEWS Objects/unicodeobject.c

Terry Reedy tjreedy at udel.edu
Mon Mar 7 20:49:19 CET 2011


On 3/7/2011 5:54 AM, Victor Stinner wrote:

>> I don’t really understand this message (especially “cached into the
>> object”) :)  Maybe in the Misc/NEWS entry you could also add a line to
>> explain to users the reason/goal/benefit of this change?
>
> If you call str.encode() twice: the first call stores the result in a
> cache, and the second call just reuse the cache. The benefit is that the
> second call is much faster.
>
> The cache is an internal attribute of the Unicode object (str type).
>
> Do you have a suggestion to rephrase the Misc/NEWS entry?

(Without reading the entire entry,) something like:
'More consistently cached as an internal attribute of the str object for 
possible later reuse.'


-- 
Terry Jan Reedy




More information about the Python-Dev mailing list