Wiadomość napisana przez Chris McDonough w dniu 8 gru 2011, o godz. 06:08:

It would make it possible to share code like this across py2 and py3:

  a = u'foo'


As Armin himself wrote, py3k-compatible code ported from 2.x is often very ugly. This kind of change would only deepen the problem.

-1


Or:

  from __future__ import unicode_literals
  a = 'foo'

I recognize that the last option is probably the way "its meant to be
done"

Yes, that's the reason 2.x has b''. If Python 2.8 ever came to be, making this __future__ work with the standard library would be the right way to do it.

-- 
Pozdrawiam serdecznie,
Łukasz Langa
Senior Systems Architecture Engineer

IT Infrastructure Department
Grupa Allegro Sp. z o.o.


Pomyśl o środowisku naturalnym zanim wydrukujesz tę wiadomość!
Please consider the environment before printing out this e-mail.