[Python-Dev] Classes that claim to be defined in __builtin__ but aren't

Michael Hudson mwh at python.net
Tue Aug 10 15:55:19 CEST 2004


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

> There's a fair number of classes that claim they are defined in
> __builtin__, but do not actually appear there. For example:

"__builtin__" is the "I don't know" answer in type_module for
non-HEAPTYPEs.  I'm certainly not sure that's totally wise...

> 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.

Cheers,
mwh

-- 
3. Syntactic sugar causes cancer of the semicolon.
  -- Alan Perlis, [Python-Dev] Classes that claim to be defined in __builtin__
	but	aren't

	
  • Next message: [Python-Dev] Classes that claim to be defined in __builtin__ but aren't
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  • More information about the Python-Dev mailing list

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant