2.2 features

Gustavo Niemeyer niemeyer at conectiva.com
Tue Jul 31 19:03:02 EDT 2001


> >     Guido> I love it.  'x in type' as a shorthand for isinstance(x, type).
> >     Guido> Checked into CVS!
> > 
> > How about 'x in type' as a shorthand for 'issubclass(x, type)' if x is a
> > type or class instead of an instance?
> 
> No, that would be ambiguous.  A subclass is not an instance.  A class
> or type represents a set of instances, so 'in' is justified in a
> sense.

I'm a little bit confused also. A class/type is a set of instances, but
at the same time, an instance is built from a set of classes/types,
right?

This way, what would be correct? "x in type" or "type in x"?

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]




More information about the Python-list mailing list