<div dir="ltr"><div class="gmail_quote"><div>This suggestion is really problematic IMHO.</div><div><br></div><div>"isinstance" is a nominal check. I can't ask "isinstance(x, Callable[int, int])" because that would imply solving the halting problem. so "isinstance(x, Y)" does not mean "is it true that x is an element of the type Y" but rather "is it true that x was created by a constructor of some superclass of Y". It is not a type-theoretic question but a question of origin and intent.</div><div><br></div><div>With regard to readability, this will be completely confusing for me. "in" is a question about inclusion in a collection, not some set-theoretic inclusion. Otherwise we should also as "x in f" as an equivalent to "not not f(x)", as is in set theory.</div><div><br></div><div>Elazar</div></div></div>