[Python-3000] Fwd: proposal: disambiguating type

Guido van Rossum guido at python.org
Tue May 23 18:54:57 CEST 2006


On 5/22/06, Talin <talin at acm.org> wrote:
> Guido van Rossum wrote:
> > I think this is a reasonable suggestion. Perhaps less code would break
> > if you renamed the metaclass instead of the inquiry function.
> >
> > --Guido
>
> I'd like to lend my support to Tomer's proposal. I have been confused
> (repeatedly, which is a bad sign) by the conflation of the type-query
> and type-construction uses of 'type'.
>
> As far as renaming the metaclass goes, I think that 'type' is a really
> good name for the metaclass, so even if it would break less things,
> there's a strong mnemonic value in keeping it the way it is. I think
> 'typeof' is a reasonably good name for the query function.

Doesn't convince me. Python doesn't have any "xyzzyof" functions; I
find this quite ugly -- and xyzzy_of is no better due to the dreaded
underscore. After all, we don't write lenof(seq).

And I'm not sure why 'type' is such a great name for the metaclass --
it just doesn't express clearly what it is (if anything, it ought to
be called "class" or "Class").

Finally, type() the function is older.

> (In fact, the first time I tried to use type( x ), I accidentally typed
> 'typeof( x )'. So this is one data point as to how intuitive the name is.)

The only intuitive interface is the nipple. Everything else is
learned. (Jef Raskin, I believe.)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list