[Python-Dev] PEP 414 - Unicode Literals for Python 3

Guido van Rossum guido at python.org
Mon Feb 27 19:17:57 CET 2012


On Mon, Feb 27, 2012 at 10:01 AM, Chris McDonough <chrism at plope.com> wrote:
> The best argument is that there already exists tons and tons of Python 2
> code that already does:
>
>  u'that'

+1

> Needing to change it to:
>
>  u('that')
>
> 1) Requires effort on the part of a from-Python-2-porter to service
>   the aesthetic and populist goal of not having an explicit
>   but redundant-under-Py3 literal syntax that says "this is text".
>
> 2) Won't actually meet the aesthetic goal, as
>   it's uglier and slower under *both* Python 2 and Python 3.
>
> So the populist argument remains.. "it's too confusing for people who
> learn Python 3 as a new language to have a redundant syntax".  But we've
> had such a syntax in Python 2 for years with b'', and, as mentioned by
> Armin's PEP single-quoted vs. triple-quoted strings forever.
>
> I just don't understand the pushback here at all.  This is such a
> nobrainer.

I agree. Just let's start deprecating it too, so that once Python 2.x
compatibility is no longer relevant we can eventually stop supporting
it (though that may have to wait until Python 4...). We need to send
*some* sort of signal that this is a compatibility hack and that no
new code should use it. Maybe a SilentDeprecationWarning?

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list