Dynamic comparison operators

Paul Rubin no.email at nospam.invalid
Thu May 24 21:36:57 EDT 2012


mlangenhoven at 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.

import operator

test(val1, val2, operator.ge)



More information about the Python-list mailing list