<p>FWIW, the restriction to tuples is to avoid burdening the recursive C code with checks for cycles. Please keep that property.</p>
<div class="gmail_quote">On Jul 3, 2011 3:47 PM, "Michael Foord" <<a href="mailto:fuzzyman@gmail.com">fuzzyman@gmail.com</a>> wrote:<br type="attribution">> Hello all,<br>> <br>> Occasionally I build up tuples of types for passing as the second argument<br>
> to isinstance. I've noticed on occasions having duplicates, for example the<br>> following code is Python 2 & 3 compatible but results in a duplicate on one<br>> of them:<br>> <br>> FunctionTypes = (<br>
>     # python function<br>>     type(create_autospec),<br>>     # instance method<br>>     type(ANY.__eq__),<br>>     # unbound method<br>>     type(_ANY.__eq__),<br>> )<br>> <br>> It would feel cleaner to me if I could make FunctionTypes a set and use that<br>
> as the second argument to isinstance. :-)<br>> <br>> Michael<br>> <br>> -- <br>> <br>> <a href="http://www.voidspace.org.uk/">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">http://www.sqlite.org/different.html</a><br>
</div>