From: Andrew Svetlov Date: Thu, 29 Nov 2012 17:51:28 +0000 (+0200) Subject: Issue #16194: document imp.load_dynamic problems X-Git-Tag: v2.7.4rc1~337^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a5c2e64d9cd84618d96d05f1b43579e6deecb35;p=thirdparty%2FPython%2Fcpython.git Issue #16194: document imp.load_dynamic problems when read several extension modules from the same binary object file. --- diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst index 02c2cf98837a..04bc6f58775c 100644 --- a/Doc/library/imp.rst +++ b/Doc/library/imp.rst @@ -237,6 +237,17 @@ around for backward compatibility: using shared libraries is highly system dependent, and not all systems support it.) + .. impl-detail:: + + The import internals identify extension modules by filename, so doing + ``foo = load_dynamic("foo", "mod.so")`` and + ``bar = load_dynamic("bar", "mod.so")`` will result in both foo and bar + referring to the same module, regardless of whether or not + ``mod.so`` exports an ``initbar`` function. On systems which + support them, symlinks can be used to import multiple modules from + the same shared library, as each reference to the module will use + a different file name. + .. function:: load_source(name, pathname[, file])