Re: Should I cache LoadLibrary results?
"Martin (gzlist)" <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
On 03/05/2010, Alexander Belchenko <[email protected]> wrote: > > Question itself: does ctypes do any sort of caching of cdll.LoadLibrary > results (for successfully loaded libraries) or should I care about not > loading the library several times? Using `ctypes.cdll.foo` or `ctypes.cdll['foo']` will cache a successful dlopen, but `ctypes.cdll.LoadLibrary('foo')` will not, see the LibraryLoader code: <http://svn.python.org/view/python/branches/release25-maint/Lib/ctypes/__init__.py?&view=markup#LibraryLoader> Martin ------------------------------------------------------------------------------