[Python-Dev] New universal import mechanism ( Re:
[Python-checkins] python/dist/src/Python import.c,2.210,2.211)
David Abrahams
dave@boost-consulting.com
Mon, 02 Dec 2002 17:33:25 -0500
"Wiktor Sadowski" <art@wiktorsadowski.com> writes:
> I think Python should have a more universal import mechanism , which could be done
> by adding a new C_CUSTOM type to the definitions for dynamic loading (importdl.h) ,
> a new struct _customtab to import.h and a new function to Python API (import.c).
> Then any archive,database,internet import architecture could be implemented
> in C extensions without messing with Python core.
As long as we're discussing changes to the import mechanism, I'll
mention a facility that some of my users want. I apologize in advance
for not knowing whether the proposed patch covers this ability or not.
My users want extension modules to be able to control how their
attributes are imported when using "import *". In particular,
Boost.Python includes a kind of multimethod facility, and some of my
users would like it if
from bpl_extension import *
caused multimethod definitions in bpl_extension to be /merged/ into
the current module, rather than replacing any multimethod bindings
with the same name in the current module.
-Dave
--
David Abrahams
dave@boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution