[Python-3000] gettype (original) (raw)

Talin talin at acm.org
Wed Aug 2 04:29:51 CEST 2006


tomer filiba wrote:

that's surly anachronism :)

o.class is a little more typing and will surely scare newbies. moreover, type(x) and x.class can return different things (you can fool class, but not type()). for my part, i'm fine with any form that makes a distinction between the metaclass "type" and the inquire-type "type". call it o.class, gettype() or typeof(), just don't mix that with the metaclass

From a code style perspective, I've always felt that the magical underscore names should not be referred to ouside of the class implementing those names. The double underscores are an indication that this method or property is in most normal use cases referred to implicitly by use rather than explicitly by name; Thus str() invokes str and so on.

-- Talin



More information about the Python-3000 mailing list