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


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to