On Feb 27, 2012, at 09:43 PM, Vinay Sajip wrote: >Well, according to the approach I described above, that one thing needs to be >the present 3.x syntax - 'xxx' is text, b'xxx' is bytes, and f('xxx') is >native string (or whatever name you want instead of f). With the >unicode_literals import, that syntax works on 2.6+ and 3.2+, so ISTM it >should work within the constraints you mentioned for your software.
I agree, this works for me and it's what I do in all my code now. Strings adorned with u-prefixes just look unnatural, and there's no confusion that unadorned strings mean "unicode". And yes, I have had to use str('') occasionally to mean "native strings", but it's so rare and constant cost that I didn't even think twice about it after I discovered this trick. But it seems like this is just not an acceptable solution for proponents of the PEP. Given that the above is the most generally accepted way to spell these things in the Python versions we care about today (>= 2.6, 3.2), at the very least, the PEP needs to be rewritten to make it clear why the above is unacceptable. That's the only way IMO that the PEP can be judged on its own merits. (I'll concede for the sake of argument that 2to3 is unacceptable. I also think it's unnecessary though.) Cheers, -Barry _______________________________________________ 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