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

R. David Murray rdmurray at bitdance.com
Mon Feb 27 21:11:34 CET 2012


On Mon, 27 Feb 2012 10:17:57 -0800, Guido van Rossum <guido at python.org> wrote:
> 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.

It's obviously not a *no*-brainer or you wouldn't be getting pushback :)

I view most of the pushback as people wanting to make sure all the
options have been carefully considered.  This should all be documented
in the PEP.

> 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?

Isn't that what PendingDeprecationWarning is?  This seems like the kind
of use case that was introduced for (though it is less used now that
DeprecationWarnings are silent by default).

--David


More information about the Python-Dev mailing list