Want to Use filter() with multi-variable function

Jeffrey Templon (templon@paramount.nikhefk.nikhef.nl)
Wed, 27 Jul 1994 13:52:25 GMT

Hi,

I have a list of numbers; I want a quick and efficient way to
find the subset of these numbers which lie between two limits.
However these numbers are determined within the program itself.

I wanted to do something like

def checklims(a,b,c) :
if a >= b and a < c :
return 1
else :
return 0

...

newlist = filter(checklims,oldlist)

The problem is (as far as I can tell) that filter expects to get
a one-parameter function, and supplies each element of that list
as a parameter, one by one. So how do I tell "checklims" which
limits to use??

I can't wait to see the Tim Peters solution on this one (where IS that
guy anyway??)

JT