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

James Y Knight foom at fuhm.net
Thu Aug 12 23:28:05 CEST 2004


On Aug 10, 2004, at 8:02 PM, Guido van Rossum wrote:

Sooo should (for 'generator' in objects that claim to be in builtins but aren't), 1) 'generator' be added to builtins 2) 'generator' be added to types.py and its module be set to 'types' 3) 'generator' be added to .py and its module be set to '' (and a name for the module chosen) I guess (1). Please submit a patch to SF...

Okay, so, I don't have a patch, but I have made a script to examine the situation. It seems the problem is a little more widespread than I had realized. I grepped through the python C source to find all the type objects, and then verified their existence. Just looking at Objects/*.c, there are 31 classes without appropriate bindings. Additionally, some aren't even valid identifier names. It seems like there's 4 categories here: iterators, descrobject stuffs, list comparison wrappers, and other. I'm not sure it's a good idea to add all these names to the builtins -- perhaps only the ones in the 'other' group?

For {Modules,Mac,PC,RISCOS,Python}/*.c, most seem like they could relatively straightforwardly be added to their module, but I haven't examined them too closely. Some likely ought to have constructors added (e.g. the dl.dl('file') could be equivalent to dl.open('file')).

builtin.dictionary-keyiterator not found (./Objects/dictobject.c) builtin.dictionary-valueiterator not found (./Objects/dictobject.c) builtin.dictionary-itemiterator not found (./Objects/dictobject.c) builtin.tupleiterator not found (./Objects/tupleobject.c) builtin.rangeiterator not found (./Objects/rangeobject.c) builtin.iterator not found (./Objects/iterobject.c) builtin.callable-iterator not found (./Objects/iterobject.c) builtin.listiterator not found (./Objects/listobject.c) builtin.listreverseiterator not found (./Objects/listobject.c)

builtin.method_descriptor not found (./Objects/descrobject.c) builtin.classmethod_descriptor not found (./Objects/descrobject.c) builtin.member_descriptor not found (./Objects/descrobject.c) builtin.getset_descriptor not found (./Objects/descrobject.c) builtin.wrapper_descriptor not found (./Objects/descrobject.c) builtin.method-wrapper not found (./Objects/descrobject.c)

builtin.sortwrapper not found (./Objects/listobject.c) builtin.cmpwrapper not found (./Objects/listobject.c)

builtin.ellipsis not found (./Objects/sliceobject.c)
types.EllipsisType builtin.builtin_function_or_method not found (./Objects/methodobject.c) types.BuiltinFunctionType types.BuiltinMethodType builtin.dictproxy not found (./Objects/descrobject.c)
types.DictProxyType builtin.generator not found (./Objects/genobject.c)
types.GeneratorType builtin.PyCObject not found (./Objects/cobject.c) builtin.classobj not found (./Objects/classobject.c)
types.ClassType builtin.instance not found (./Objects/classobject.c)
types.InstanceType builtin.instancemethod not found (./Objects/classobject.c)
types.MethodType types.UnboundMethodType builtin.cell not found (./Objects/cellobject.c) builtin.NoneType not found (./Objects/object.c) types.NoneType builtin.NotImplementedType not found (./Objects/object.c)
types.NotImplementedType builtin.frame not found (./Objects/frameobject.c)
types.FrameType builtin.function not found (./Objects/funcobject.c)
types.FunctionType types.LambdaType builtin.module not found (./Objects/moduleobject.c)
types.ModuleType

(the Mac ones I checked on my mac w/ python 2.3.0) _Qt.IdleManager not found (./Mac/Modules/qt/_Qtmodule.c) _Qt.SGOutput not found (./Mac/Modules/qt/_Qtmodule.c) module _OSA not installed (./Mac/Modules/osa/_OSAmodule.c) Nav.NavReplyRecord not found (./Mac/Modules/Nav.c) _Scrap.Scrap not found (./Mac/Modules/scrap/_Scrapmodule.c) module waste not installed (./Mac/Modules/waste/wastemodule.c) MacOS.ResourceFork not found (./Mac/Modules/macosmodule.c) icglue.ic_instance not found (./Mac/Modules/icgluemodule.c)

builtin.PyHKEY not found (./PC/_winreg.c) builtin.drawf not found (./RISCOS/Modules/drawfmodule.c) builtin.block not found (./RISCOS/Modules/swimodule.c) builtin.traceback not found (./Python/traceback.c)
types.TracebackType builtin.code not found (./Python/compile.c) types.CodeType builtin.symtable entry not found (./Python/symtable.c) builtin.tktimertoken not found (./Modules/_tkinter.c) builtin.tkapp not found (./Modules/_tkinter.c) builtin.arrayiterator not found (./Modules/arraymodule.c) _curses_panel.curses panel not found (./Modules/_curses_panel.c) linuxaudiodev.linux_audio_device not found (./Modules/linuxaudiodev.c) module fl not installed (./Modules/flmodule.c) builtin.DB not found (./Modules/_bsddb.c) builtin.DBCursor not found (./Modules/_bsddb.c) builtin.DBEnv not found (./Modules/_bsddb.c) builtin.DBTxn not found (./Modules/_bsddb.c) builtin.DBLock not found (./Modules/_bsddb.c) sha.SHA not found (./Modules/shamodule.c) module sv not installed (./Modules/svmodule.c) itertools._grouper not found (./Modules/itertoolsmodule.c) itertools.tee_dataobject not found (./Modules/itertoolsmodule.c) rotor.rotor not found (./Modules/rotormodule.c) module cl not installed (./Modules/clmodule.c) _sre.SRE_Pattern not found (./Modules/_sre.c) _sre.SRE_Match not found (./Modules/_sre.c) _sre.SRE_Scanner not found (./Modules/_sre.c) socket.SSL not found (./Modules/_ssl.c) _curses.curses window not found (./Modules/_cursesmodule.c) parser.st not found (./Modules/parsermodule.c) cStringIO.StringO not found (./Modules/cStringIO.c) cStringIO.StringI not found (./Modules/cStringIO.c) module sunaudiodev not installed (./Modules/sunaudiodev.c) module dbm not installed (./Modules/dbmmodule.c) dl.dl not found (./Modules/dlmodule.c) module fm not installed (./Modules/fmmodule.c) regex.regex not found (./Modules/regexmodule.c) pyexpat.xmlparser not found (./Modules/pyexpat.c) builtin.MultibyteCodec not found (./Modules/cjkcodecs/multibytecodec.c) builtin.MultibyteStreamReader not found (./Modules/cjkcodecs/multibytecodec.c) builtin.MultibyteStreamWriter not found (./Modules/cjkcodecs/multibytecodec.c) bsddb.bsddb not found (./Modules/bsddbmodule.c) module cd not installed (./Modules/cdmodule.c) cPickle.Pdata not found (./Modules/cPickle.c) module al not installed (./Modules/almodule.c) builtin.deque_iterator not found (./Modules/collectionsmodule.c) builtin.deque_reverse_iterator not found (./Modules/collectionsmodule.c) thread.lock not found (./Modules/threadmodule.c) zlib.Compress not found (./Modules/zlibmodule.c) zlib.Decompress not found (./Modules/zlibmodule.c) gdbm.gdbm not found (./Modules/gdbmmodule.c) ossaudiodev.oss_audio_device not found (./Modules/ossaudiodev.c) ossaudiodev.oss_mixer_device not found (./Modules/ossaudiodev.c)



More information about the Python-Dev mailing list