On Thu, Jan 3, 2013 at 12:55 AM, Marius Gedminas <[email protected]> wrote:
> On Wed, Jan 02, 2013 at 04:15:17PM +1100, Martin Pool wrote:
> > My previous patch to warn about unknown backslash escapes was buggy, and
> > warns on "\0" or "\177". This fixes it.
> >
> > As I say in a comment, I do wonder if octal escapes are so rare today
> that
> > they often indicate incorrect escaping. In my survey of some Google
> code,
> > I do see things like "\1" used much more often as a regexp replacement
> than
> > as an octal escape. How would you feel about an (of course suppressable)
> > warning for non-zero octal characters?
>
> \033 is useful for colourful ANSI sequences, if one's too lazy to go
> through curses.tigetstr("af"/"ab").
>
This is true, but it's not much worse to write it is hex '\x1b', eg
'\x1b[1mhi mgedminas\x1b[0m'. Probably in practice one would have a
variable or function to emit stuff rather than typing the literal
repeatedly...
-m
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects