(original) (raw)

changeset: 80661:94de77bd0b4b branch: 2.7 parent: 80651:ea4bdf5a2e69 user: Andrew Svetlov andrew.svetlov@gmail.com date: Thu Nov 29 19:51:28 2012 +0200 files: Doc/library/imp.rst description: Issue #16194: document imp.load_dynamic problems when read several extension modules from the same binary object file. diff -r ea4bdf5a2e69 -r 94de77bd0b4b Doc/library/imp.rst --- a/Doc/library/imp.rst Thu Nov 29 14:22:26 2012 +0200 +++ b/Doc/library/imp.rst Thu Nov 29 19:51:28 2012 +0200 @@ -237,6 +237,17 @@ 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]) /andrew.svetlov@gmail.com