[Python-ideas] Is there a good reason to use * for multiplication?

Joshua Landau joshua.landau.ws at gmail.com
Mon Oct 15 04:05:30 CEST 2012


On 15 October 2012 01:35, MRAB <python at mrabarnett.plus.com> wrote:

> On 2012-10-15 01:12, Joshua Landau wrote:
>
>> On 15 October 2012 00:46, MRAB <python at mrabarnett.plus.com
>> <mailto:python at mrabarnett.**plus.com <python at mrabarnett.plus.com>>>
>> wrote:
>>
>>     OK, but what about raw string literals? Currently, "\\u0190" ==
>>     r"\u0190", but "\\u0190" != r"Ɛ".
>>
>>
>> The “r"” prefix escapes all escapes, so will escape this escape too.
>> Hence, this behaviour is un...escaped ;).
>>
>>  If "\u0190" becomes "Ɛ", what happens to "\u000A"? Currently it's
> legal. :-)


The python interpreter could distinguish between its morphed Unicode
escapes and the originals - the escapes would never match against
already-syntactically-relevant constructs*. Hence "a \u0069s b"
is equivalent to "a i\u0073 b" but *not* "a is b": the first two are
defined by __op_is__ and the last is just the "is" keyword.

Hence, \u000A would just act like a character, and be definable as an
operator, and have little to do with the newline character.

Nice try, but the proposal stands firm.

* Except, of course, the old operators which will be phased into the new
mechanism.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121015/47e9e302/attachment.html>


More information about the Python-ideas mailing list