In message <[EMAIL PROTECTED]>, Cameron Laird wrote:

> In article <[EMAIL PROTECTED]>,
> Lawrence D'Oliveiro  <[EMAIL PROTECTED]> wrote:
>
>>Cameron Laird wrote:
>>
>>> I've been trying to decide if there's any sober reason to advocate
>>> the one-liner
>>> 
>>>     map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024])
>>
>>Are lambdas like the Dark Side of Python?
>>
>>:)
> 
> Enough so, apparently, that I'm reluctant even to touch that question.

So how else would you express something like

    def shell_escape(Arg) :
        """returns Arg suitably escaped for use as a command-line argument
        to Bash."""
        return \
            re.sub \
              (
                r"[\<\>\"\'\|\&\$\#\;\(\)\[\]\{\}\`\!\~\ \\]",
                lambda Match : "\\" + Match.group(0),
                Arg
              )
              # Need to catch anything that might be meaningful to shell
    #end shell_escape

?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to