Cost of "unicode(s)" where s is Unicode

Christian Heimes lists at cheimes.de
Sun Jan 6 11:13:58 EST 2008


John Nagle wrote:
>    Does
> 
> 	text = unicode(text)
> 
> make a copy of a Unicode string, or is that essentially a
> free operation if the input is already Unicode?

>>> u = u"some long unicode object"
>>> unicode(u) is u
True



More information about the Python-list mailing list