[Python-Dev] Access to generator type (original) (raw)

Tim Peters tim.one at comcast.net
Mon May 10 22:27:03 EDT 2004


[James William Pye]

Can access to the generator type(gentype in ceval.c) and associated data/structures be made available in a public interface/header(genobject.h)?

Possibly, if someone wants it enough to make a patch (including doc changes). There are many types that aren't exposed at the C level, BTW. Advertising their internals has an inhibiting effect on evolution. The generator type has been around long enough w/o change that the value in keeping it private has diminished.

I know I can get the type by compiling a little generator and fetching its type, but that seems to be a bit redundant as each project that needs it, needs to make its own, nonstandardized version of access.

Anyone who wants it can do

from types import GeneratorType

today (types is a standard Python module).



More information about the Python-Dev mailing list