eryksun added the comment:

> How does this relate to issue 14201?  That is, is the answer just 
> "use getitem if you don't want caching"? 

Unlike CDLL.__getitem__, LibraryLoader.__getitem__ does use the attribute 
cache. Why use a LibraryLoader if you don't want the cached libs and access to 
their cached function pointers? That's its main reason for existing.  But 
really only in Windows, since most DLL names work as a attributes and Windows 
LoadLibrary appends .DLL. If you don't want cached libs, don't use a 
LibraryLoader. Just use CDLL('msvcr100'), WinDLL('kernel32'), etc. If you want 
cached libs without polluting ctypes.cdll or ctypes.windll, just create your 
own instance such as windll = ctypes.LibraryLoader(ctypes.WinDLL).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22552>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to