escaping/encoding/formatting in python

rusi rustompmody at gmail.com
Fri Apr 6 01:28:19 EDT 2012


On Apr 6, 10:13 am, Steve Howell <showel... at yahoo.com> wrote:
> On Apr 5, 9:59 pm, rusi <rustompm... at gmail.com> wrote:
>
> > On Apr 6, 6:56 am, Steve Howell <showel... at yahoo.com> wrote:
>
> > > One of the biggest nuisances for programmers, just beneath date/time
> > > APIs in the pantheon of annoyances, is that we are constantly dealing
> > > with escaping/encoding/formatting issues.
>
> > [OT for this list]
> > If you run
> > $ find /usr/share/emacs/23.3/lisp/ -name '*.gz'|xargs zgrep '\\\\\\\\\\
> > \\\\\\'
> > you can get quite a few results.
>
> > [Suitable assumptions: linux box with emacs installed]
>
> You've one-upped me with 2-to-the-N backslash escaping.  I've written
> useful scripts before with "\\\\\\\\" (scripts that went through
> three
> levels of interpretation), but four is setting a new bar.  My use of
> three exponentially increasing levels of backslashes back in the day
> was like Beamon's jump in the Mexico City Olympics.  An amazing feat
> for its time, but every record
> eventually gets broken.  Well done.

There was a competition here?!
If so I can break my own record -- double the number of backslashes
and you still get hits.
Its just that I was unsure of my ability at typing 32 backslashes (and
making a reasonable post).

On a more serious note this indicates that it is (may be?) a bad idea
for old-fashioned languages (like elisp and C) to have only 1 string-
quoter.

May-be-question-mark because programming language experience tells us
that avoiding recursion (in its infinite guises) by special-casing is
usually a bad idea.

All this mess would vanish if the string-literal-starter and ender
were different.
[You dont need to escape a open-paren in a lisp sexp]



More information about the Python-list mailing list