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

Rob Williscroft rtw at
Sun Jan 6 17:07:34 CET 2008

John Nagle wrote in news:4780fb68$0$36341$742ec2ed at in 

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

  ... More precisely, if object is a Unicode string or subclass it 
  will return that Unicode string without any additional decoding 


More information about the Python-list mailing list