
March 2, 2017
8:35 a.m.
This suggestion is really problematic IMHO. "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. 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. Elazar