On Sat, Mar 3, 2012 at 10:26, Vinay Sajip <vinay_sa...@yahoo.co.uk> wrote: > Lennart Regebro <regebro <at> gmail.com> writes: > >> So the question is if you have any proposal that is *less* confusing >> while still being practical. Because we do need to distinguish between >> binary, Unicode and "native" strings. Isn't this the least confusing >> solution? > > It's a matter of the degree of confusion caused (hard to assess) and also a > question of taste, so there will be differing views on this. Considering use > of > unicode_literals, 'xxx' for text, b'yyy' for bytes and with a function wrapper > to mark native strings, it becomes clear that the native strings are special > cases - much less encountered when looking at code compared to 'xxx' / b'yyy',
I'm not sure that's true at all. In most cases where you support both Python 2 and Python 3, most strings will be "native", ie, without prefix in either Python 2 or Python 3. The native case is the most common case. > In terms of practicality, it is > IMO quite practical (assuming 2.5 / earlier support can be dropped) to move > to a > 2.6+/3.x-friendly codebase, e.g. by using Armin's python-modernize. I think there is some misunderstanding here. The binary/unicode/native separation is only possible on Python 2.6 and 2.7 at the moment, unless you use function wrappers like b(). //Lennart _______________________________________________ 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