> It would make it possible to share code like this across py2 and py3: > > a = u'foo' > > Instead of (with e.g. six): > > a = u('foo') > > Or: > > from __future__ import unicode_literals > a = 'foo' > > I recognize that the last option is probably the way "its meant to be > done", but in reality it's just more practical to not fail when literal > notation is more specific than strictly necessary.
You are giving these two options already: - The former works for all Python versions. Although it may appear tedious to convert existing code to replace all Unicode literals with function calls, it would actually be possible/easy to write an automatic converter that does so for a complete code base, based on lib2to3. - the second version is truly practical for all applications/libraries that only support 2.6+. In addition, there also is another option: - use 2to3, in some form So you have already three solutions which are all transitional in some sense, and you want yet another option? I fail to see why this option is more practical than the options that are already there. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com