unicode-literals

Unicode literals that work in python 3 and 2

Unicode literals that work in python 3 and 2 Question: So I have a python script that I’d prefer worked on python 3.2 and 2.7 just for convenience. Is there a way to have unicode literals that work in both? E.g. #coding: utf-8 whatever = ‘שלום’ The above code would require a unicode string in …

Total answers: 2

Any gotchas using unicode_literals in Python 2.6?

Any gotchas using unicode_literals in Python 2.6? Question: We’ve already gotten our code base running under Python 2.6. In order to prepare for Python 3.0, we’ve started adding: from __future__ import unicode_literals into our .py files (as we modify them). I’m wondering if anyone else has been doing this and has run into any non-obvious …

Total answers: 6