Hello all,<div><br></div><div>Occasionally I build up tuples of types for passing as the second argument to isinstance. I've noticed on occasions having duplicates, for example the following code is Python 2 & 3 compatible but results in a duplicate on one of them:</div>
<div><br></div><div><div>FunctionTypes = (</div><div>    # python function</div><div>    type(create_autospec),</div><div>    # instance method</div><div>    type(ANY.__eq__),</div><div>    # unbound method</div><div>    type(_ANY.__eq__),</div>
<div>)</div><div><br></div><div>It would feel cleaner to me if I could make FunctionTypes a set and use that as the second argument to isinstance. :-)</div><div><br></div><div>Michael</div><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br>
<br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>

<br>
</div>