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

Antoine Pitrou solipsis at pitrou.net
Sun Feb 26 18:45:47 CET 2012


Hi,

On Sat, 25 Feb 2012 20:23:39 +0000
Armin Ronacher <armin.ronacher at active-4.com> wrote:
> 
> I just uploaded PEP 414 which proposes am optional 'u' prefix for string
> literals for Python 3.
> 
> You can read the PEP online: http://www.python.org/dev/peps/pep-0414/

I don't understand this sentence:

> The automatic upgrading of binary strings to unicode strings that
> would be enabled by this proposal would make it much easier to port
> such libraries over.

What "automatic upgrading" is that talking about?

> For instance, the urllib module in Python 2 is using byte strings,
> and the one in Python 3 is using unicode strings.

Are you talking about urllib.parse perhaps?

> By leveraging a native string, users can avoid having to adjust for
> that.

What does "leveraging a native string" mean here?

> The following is an incomplete list of APIs and general concepts that
> use native strings and need implicit upgrading to unicode in Python
> 3, and which would directly benefit from this support

I'm confused. This PEP talks about unicode literals, not native string
literals, so why would these APIs "directly benefit from this support"?

Thanks

Antoine.




More information about the Python-Dev mailing list