Alain Ketterlin writes: > mlangenho...@gmail.com writes: > > > I would like to pass something like this into a function > > test(val1,val2,'>=') > > > > and it should come back with True or False. > > def test(x,y,c): > return c(x,y) > > Call with: test(v1,v2, lambda x,y:x<=y ). A bit noisy imho.
Re noisy: import operator as o test(v1, v2, o.le) -- http://mail.python.org/mailman/listinfo/python-list