On Fri, Mar 3, 2017 at 12:44 AM, Steven D'Aprano <st...@pearwood.info> wrote: > Compare to the OP's suggestion: > > 23 in int > > This doesn't even make sense unless you have been exposed to a very > small subset of theoretical computer science which treats classes as > sets and instances as elements of those sets. To everyone else, > especially those with a background in "ordinary" OOP, it looks like > nonsense. > > (Personally, I'm a bit dubious about conflating is-a and element-of > operations in this way, it feels like a category mistake to me, but for > the sake of the argument I'll accept it.)
I've seen languages in which types can be the RHO of 'is', so this would look like: 23 is int Obviously that depends on types not themselves being first-class objects, but it makes a lot more sense than a containment check. But I'm trying to think how frequently I do *any* type checking in production code. It's not often. It doesn't need syntax. isinstance(23, int) works fine. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/