Re: PEP 3107 Function Annotations for review and comment

2006-12-30 Thread Tim Smith
here's a potentially nifty way of adding decorators to input args for python: def a(int(arg1), arg2, tuple(arg3)): #arg1 is an int (or was converted to an int) #arg2's type is not known (ie this decoration is optional) #arg3 is a tuple (may have been a list coming in, but is now a t

Re: Can I beat perl at grep-like processing speed?

2006-12-29 Thread Tim Smith
you may not be able to beat perl's regex speed, but you can take some steps to speed up your python program using map and filter here's a modified python program that will do your search faster #!/usr/bin/env python import re r = re.compile(r'destroy', re.IGNORECASE) def stripit(x): return