[openstack-dev] [Solum] Unicode strings in Python3
Ivan Melnikov
imelnikov at griddynamics.com
Fri Dec 6 07:50:21 UTC 2013
On 05.12.2013 20:42, Georgy Okrokvertskhov wrote:
> On Thu, Dec 5, 2013 at 8:32 AM, Christopher Armstrong <
> chris.armstrong at rackspace.com> wrote:
>
>> On Thu, Dec 5, 2013 at 3:26 AM, Julien Danjou <julien at danjou.info> wrote:
>>
>>> On Wed, Dec 04 2013, Georgy Okrokvertskhov wrote:
>>>
>>>> Quick summary: you can't use unicode() function and u' ' strings in
>>> Pyhton3.
>>>
>>> Not that it's advised, but you can use u' ' back again with Python 3.3.
>>>
>>>
>> And this is a very useful feature for projects that want to have a single
>> codebase that runs on both python 2 and python 3, so it's worth taking
>> advantage of.
>>
>
> You are right. PEP 414 introduces u"" literals in Python3.3. Unicode()
> function still does not work and should be avoided in the code, though.
Also let me remind that there is always six.text_type for those who
really need it.
--
WBR,
Ivan A. Melnikov
More information about the OpenStack-dev
mailing list