On Mon, Jun 18, 2012 at 3:59 PM, "Martin v. Löwis" <mar...@v.loewis.de> wrote:
> On 17.06.2012 22:41, Guido van Rossum wrote:
>> Would it make sense to detect and reject these in 3.3 if the 2.7 syntax
>> is used?
>
> Maybe we are talking about different things: The (new) proposal is that
> the ur prefix in 3.3 is a syntax error (again, as it was before PEP
> 414). So, yes: the raw unicode literals will be rejected (not by
> explicitly detecting them, though).

I think GvR was replying to my email where I was briefly reconsidering
the idea of keeping them around (because the unicode_literals future
import already suffers from this problem of literals that don't mean
the same things in 2.x and in 3.x). However, that was flawed reasoning
on my part - simply banning them altogether in 3.x is the simplest
option to ensure this particular error doesn't pass silently,
especially since there are alternate forward compatible ways to write
them, such as:

Python 2.7.3 (default, May 29 2012, 14:54:22)
>>> from __future__ import unicode_literals
>>> print(u"\u03b3" r"\n")
γ\n
>>> print(u"\u03b3\\n")
γ\n

Python 3.3.0a4 (default:f1dd70bfb4c5, May 31 2012, 09:47:51)
>>> print(u"\u03b3" r"\n")
γ\n
>>> print(u"\u03b3\\n")
γ\n

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
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

Reply via email to