[Python-Dev] creating __all__ in extension modules

Fred L. Drake, Jr. fdrake@acm.org
Sat, 3 Feb 2001 17:22:00 -0500 (EST)


Tim Peters writes:
 > I'm afraid I find it hard to believe people will *keep* C-module __all__
 > lists in synch with the code as the years go by.  If we're going to do this,
 > how about adding code to Py_InitModule4 that sucks the non-underscore names
 > out of its PyMethodDef argument and automagically builds an __all__ attr?
 > Then nothing ever needs to be fiddled by hand for C modules.

  I don't think adding __all__ to C modules makes sense.  If you want
the equivalent for a module that doesn't have an __all__, you can
compute it easily enough.  Adding it when it isn't useful is a
maintenance problem that can be avoided easily enough.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations