[Python-Dev] Classes that claim to be defined in builtin but aren't (original) (raw)

Michael Hudson mwh at python.net
Tue Aug 10 16:05:40 CEST 2004


Jp Calderone <exarkun at divmod.com> writes:

Michael Hudson wrote:

James Y Knight <foom at fuhm.net> writes:

IMO classes ought to actually appear in builtin if they claim they are defined there. Doing otherwise breaks reflection, as you have to add a special case for these class names to use the appropriate object from the types module instead. Thoughts? If it isn't desirable to have these names appear in builtin, perhaps their 'module' should be changed to another module where they are defined? Such as? There really isn't a module where e.g. GeneratorType is defined.

Seems perfectly reasonable and useful to add GeneratorType and others to the types module. I have code, for example, like this, in a couple places:

Well, it's already there, but types.GeneratorType.name is 'generator'... it could be changed to 'GeneratorType', I guess.

Cheers, mwh

-- . <- the point your article -> . |------------------------- a long way ------------------------| -- Cristophe Rhodes, ucam.chat



More information about the Python-Dev mailing list