[Python-3000] Fwd: proposal: disambiguating type

Guido van Rossum guido at python.org
Tue May 23 04:48:12 CEST 2006


On 5/22/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> tomer filiba wrote:
>
> > i suggest splitting this overloaded meaning into two separate builtins:
> > * type(name, bases, dict) - a factory for types
> > * typeof(obj) - returns the type of the object
>
> Or just drop the function usage altogether and make
> __class__ the one obvious way to find out something's
> class/type.

Well, you could overload __class__ to "lie" -- but type won't. I'd
rather not lost that functionality. I expect that with proxies
becoming more popular they may start lying about __class__. For most
purposes that's fine but I'd like to be able to tell whether I'm
dealing with a proxy, if I really need to know.

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


More information about the Python-3000 mailing list