Help, Search and Substitute

andy47 at my-deja.com andy47 at my-deja.com
Sun Nov 5 23:39:35 EST 2000


In article <8tu1eg0149s at news2.newsguy.com>,
  "Alex Martelli" <aleaxit at yahoo.com> wrote:
> <andy47 at my-deja.com> wrote in message news:8ttai1$c53
$1 at nnrp1.deja.com...
>     [snip]
> > > def symbol_replace(match, get=symbol_map.get):
> > >     return get(match.group(1), "")
>     [snip]
> > > print symbol_pattern.sub(symbol_replace, "{foo}fie{bar}")
>     [snip]
[ snipping very understandable explanation ]

Alex, many thanks. That was exactly what I was looking for. Not too
used to passing around functions as arguments myself but I am now a
wiser person.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list