ABCs -> infix syntax for isinstance() ?

Boris Borcic bborcic at gmail.com
Fri Oct 3 11:18:12 EDT 2008


Given the ABC innovation, maybe an infix syntax for isinstance() would be good.

Possibilities :

- stealing "is" away from object identity. As a motivation, true use cases for 
testing object identity are rare; forcing the usage of a function or method to 
test it, would dissuade abuse.

- allowing containment tests, ie "x in Number" to invoke isinstance() in the 
background when the container is of type <type>. My brain is too muddled by flu 
at the moment, to see whether Guido's fabled time machine allowed him to already 
provide all the necessities in py26.
Any takers ?

- combining both keywords to create a third one, eg "is in"

Whaddyathink ?

BB




More information about the Python-list mailing list