[Python-ideas] Make non-meaningful backslashes illegal in string literals

random832 at fastmail.us random832 at fastmail.us
Sat Aug 8 01:15:22 CEST 2015


On Fri, Aug 7, 2015, at 01:12, Steven D'Aprano wrote:
> \P platform-specific newline (e.g. \r\n on Windows, \n on POSIX)

There are not actually a whole hell of a lot of situations that are
otherwise cross-platform where it's _actually_ appropriate to use \r\n
on Windows.

How about unicode character names? Say what you will about \xA0 \u00A0
vs \U000000A0 (and incidentally are we ever going to deprecate octal
escapes? Or at least make them fixed-width like all the others), but you
can't really beat \N{NO-BREAK SPACE} for clarity. Of course, you'd want
a fixed set rather than Perl's insanity with user-defined ones, loose
ones, and short ones.


More information about the Python-ideas mailing list