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

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.