There's got to be an easy way to do this (fwd)
Alex Martelli
aleaxit at yahoo.com
Sun Jul 8 11:24:11 EDT 2001
"Remco Gerlich" <scarblac at pino.selwerd.nl> wrote in message
news:slrn9kgsj4.csq.scarblac at pino.selwerd.nl...
...
> > filter(string.isdigit, '(123)/456-7890')
> >
> > is six fewer characters and IMHO more readable still.
>
> That version would certainly be best, if string had a isdigit function.
You're right -- for some unfathomable version it's in module
curses.ascii instead. Oh well, filter(curses.ascii.isdigit &tc &tc, then.
Alex
More information about the Python-list
mailing list