enthought / comtypes

A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.
Other
283 stars 96 forks source link

add `_post_coinit` subpackage #571

Closed junkmd closed 3 weeks ago

junkmd commented 3 weeks ago

I have been working on reducing the weight of __init__.py since #559, but the number of files placed directly under comtypes/ has also increased.

During the initialization of the package, not all modules under comtypes/ are loaded, only a limited number of modules, such as GUID.py. It can be difficult to see at a glance which modules are needed during initialization, which can create a new cognitive load.

With this change, to make it easier to understand what modules are needed during initialization by consolidating symbols that should be defined after the call to CoInitializeEx, or symbols where the order of definition does not matter during initialization, into the _post_coinit subpackage.