<div> </div>
<div>Hello,</div>
<div> </div>
<div>You can pass an operator as an argument to your function.</div>
<div> </div>
<div>See :</div>
<div><a href="http://docs.python.org/library/operator.html">http://docs.python.org/library/operator.html</a></div>
<div><br>Regards,</div>
<div><br> </div>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b><span dir="ltr"><<a href="mailto:mlangenhoven@gmail.com">mlangenhoven@gmail.com</a>></span><br>Date: 2012/5/24<br>
Subject: Dynamic comparison operators<br>To: <a href="mailto:python-list@python.org">python-list@python.org</a><br><br><br>I would like to pass something like this into a function<br>test(val1,val2,'>=')<br><br>
and it should come back with True or False.<br><br>Is there a way to dynamically compare 2 values like this or will I have to code each operator individually?<br><span class="HOEnZb"><font color="#888888">--<br><a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></div><br>