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

random832 at fastmail.us random832 at fastmail.us
Sat Aug 8 01:05:30 CEST 2015


On Fri, Aug 7, 2015, at 01:12, Steven D'Aprano wrote:
> > (and as long as we're talking about
> > things to deprecate in string literals, how about \v?)
> 
> Why would you want to deprecate a useful and long-standing escape 
> sequence?

Because it doesn't do anything useful and no-one uses it.

http://prog21.dadgum.com/76.html
http://prog21.dadgum.com/103.html

> Admittedly \v isn't as common as \t or \n, but it still has 
> its uses, and is a standard escape familiar to anyone who uses C, C++, 
> C#, Octave, Haskell, Javascript, etc.

I challenge you to find *one* use in the wild. Just one.

Everyone does it because everyone else does it, but it's not useful to
any real users. 

Meanwhile, on the subject of _adding_ one, how about \e? [or \E. Both
printf(1) and terminfo actually support both, and \E is more "canonical"
for termcap/terminfo usage.]


More information about the Python-ideas mailing list