[Tutor] Python 2 & 3 and unittest

Peter Otten __peter__ at web.de
Thu Sep 5 08:29:30 CEST 2013


Steven D'Aprano wrote:

> On Thu, Sep 05, 2013 at 09:11:50AM +1000, Steven D'Aprano wrote:
> 
>> I don't believe there is a way to make
>> string literals unicode, you just have to get used to writing u"" and
>> b"" strings by hand.
> 
> Sorry, that is unclear. I meant to say, there is no way to force
> unprefixed strings "" to be Unicode in 2.x.

For 2.6 and above there is

from __future__ import unicode_literals




More information about the Tutor mailing list