[Python-ideas] Add \e escape code

M.-A. Lemburg mal at egenix.com
Wed Jun 12 09:24:32 CEST 2013


On 12.06.2013 08:58, Serhiy Storchaka wrote:
> 11.06.13 23:21, M.-A. Lemburg написав(ла):
>> I'm not saying that it's useful to rely on Python's behavior,
>> only that any such change has the potential to break perfectly
>> working code.
>>
>> The last time we changed the escape code was for the introduction
>> of Unicode string literals. That was 13 years ago. And we carefully
>> checked what other languages were using for Unicode at the time.
> 
> Note that in the same time \u means "Titlecase next character" and \U means "Uppercase till \E" in
> Perl. "Conforming with other languages" argument is not very suitable in this particular case.

Perl was not available as reference, since they had started thinking
about these things at the same time we did. Since Java was the first
major language to implement Unicode at the time, we followed their
approach. Turned out to be a good choice, since C++ added the same
notation in C++11.

http://en.cppreference.com/w/cpp/language/escape

> I'm -0.5. On one hand, I'm not worrying about backward compatibility, -- behavior of \e is not
> promised once for all, and there are no good reasons to use it (unlikely to backslashing
> non-letters). On other hands, it adds complexity (look at mess of dozens special escapes in Perl),
> the range of applications for this feature is enough narrow, and there are good alternatives (\x1b
> for shortness and \N{ESCAPE} for mnemonicity).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 12 2013)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2013-07-01: EuroPython 2013, Florence, Italy ...           19 days to go
2013-07-16: Python Meeting Duesseldorf ...                 34 days to go

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-ideas mailing list