comtypes 1.4.16__tar.gz → 1.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. {comtypes-1.4.16 → comtypes-1.5.0}/CHANGES.txt +37 -0
  2. {comtypes-1.4.16/comtypes.egg-info → comtypes-1.5.0}/PKG-INFO +3 -7
  3. {comtypes-1.4.16 → comtypes-1.5.0}/README.md +2 -6
  4. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/__init__.py +33 -46
  5. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_memberspec.py +116 -14
  6. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/misc.py +8 -7
  7. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_safearray.py +32 -1
  8. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/automation.py +275 -19
  9. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_activeobj.py +17 -3
  10. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_create.py +47 -11
  11. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_events.py +13 -1
  12. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/git.py +15 -26
  13. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/hints.pyi +29 -16
  14. comtypes-1.5.0/comtypes/logutil.py +28 -0
  15. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/messageloop.py +21 -3
  16. comtypes-1.5.0/comtypes/py.typed +0 -0
  17. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/safearray.py +72 -7
  18. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_basic.py +8 -11
  19. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_client.py +21 -19
  20. comtypes-1.5.0/comtypes/test/test_compatibility_tlbparser_VT_I1_assignment.py +566 -0
  21. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_comserver.py +1 -1
  22. comtypes-1.5.0/comtypes/test/test_cpp_safearray.py +178 -0
  23. comtypes-1.5.0/comtypes/test/test_eventinterface.py +155 -0
  24. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_excel.py +9 -0
  25. comtypes-1.5.0/comtypes/test/test_fixed_point_marshaling.py +456 -0
  26. comtypes-1.5.0/comtypes/test/test_fixed_point_numbers.py +571 -0
  27. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_git.py +7 -9
  28. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_logutil.py +1 -15
  29. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_midl_safearray_create.py +26 -0
  30. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_npsupport.py +87 -2
  31. comtypes-1.5.0/comtypes/test/test_packing.py +45 -0
  32. comtypes-1.5.0/comtypes/test/test_record_safearray_bstr.py +480 -0
  33. comtypes-1.5.0/comtypes/test/test_record_safearray_value.py +403 -0
  34. comtypes-1.5.0/comtypes/test/test_string_safearray_inside_variant.py +138 -0
  35. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_typeannotator.py +20 -14
  36. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_variant.py +122 -3
  37. comtypes-1.5.0/comtypes/test/test_variant_error.py +68 -0
  38. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/codegenerator.py +109 -88
  39. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/heads.py +11 -46
  40. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/helpers.py +8 -15
  41. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/namespaces.py +37 -13
  42. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/packing.py +8 -7
  43. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/typeannotator.py +46 -15
  44. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/tlbparser.py +109 -45
  45. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/typedesc.py +33 -7
  46. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/typedesc_base.py +25 -19
  47. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/util.py +11 -2
  48. {comtypes-1.4.16 → comtypes-1.5.0/comtypes.egg-info}/PKG-INFO +3 -7
  49. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes.egg-info/SOURCES.txt +10 -1
  50. {comtypes-1.4.16 → comtypes-1.5.0}/pyproject.toml +1 -4
  51. comtypes-1.4.16/comtypes/logutil.py +0 -83
  52. comtypes-1.4.16/comtypes/test/test_eventinterface.py +0 -150
  53. comtypes-1.4.16/comtypes/tools/codegenerator/comments.py +0 -79
  54. {comtypes-1.4.16 → comtypes-1.5.0}/LICENSE.txt +0 -0
  55. {comtypes-1.4.16 → comtypes-1.5.0}/MANIFEST.in +0 -0
  56. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/GUID.py +0 -0
  57. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_comobject.py +0 -0
  58. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_meta.py +0 -0
  59. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_npsupport.py +0 -0
  60. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/__init__.py +0 -0
  61. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/_cominterface_meta_patcher.py +0 -0
  62. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/activeobj.py +0 -0
  63. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/bstr.py +0 -0
  64. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/instancemethod.py +0 -0
  65. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_post_coinit/unknwn.py +0 -0
  66. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_tlib_version_checker.py +0 -0
  67. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/_vtbl.py +0 -0
  68. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/clear_cache.py +0 -0
  69. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/__init__.py +0 -0
  70. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_code_cache.py +0 -0
  71. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_constants.py +0 -0
  72. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_generate.py +0 -0
  73. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/_managing.py +0 -0
  74. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/dynamic.py +0 -0
  75. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/client/lazybind.py +0 -0
  76. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/connectionpoints.py +0 -0
  77. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/errorinfo.py +0 -0
  78. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/hresult.py +0 -0
  79. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/malloc.py +0 -0
  80. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/patcher.py +0 -0
  81. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/persist.py +0 -0
  82. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/__init__.py +0 -0
  83. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/automation.py +0 -0
  84. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/connectionpoints.py +0 -0
  85. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/inprocserver.py +0 -0
  86. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/localserver.py +0 -0
  87. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/register.py +0 -0
  88. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/server/w_getopt.py +0 -0
  89. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/shelllink.py +0 -0
  90. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/stream.py +0 -0
  91. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestComServer.idl +0 -0
  92. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestComServer.py +0 -0
  93. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestComServer.tlb +0 -0
  94. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestDispServer.idl +0 -0
  95. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestDispServer.py +0 -0
  96. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/TestDispServer.tlb +0 -0
  97. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/__init__.py +0 -0
  98. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/find_memleak.py +0 -0
  99. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/gdi_helper.py +0 -0
  100. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/monikers_helper.py +0 -0
  101. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/mylib.idl +0 -0
  102. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/mylib.tlb +0 -0
  103. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/mytypelib.idl +0 -0
  104. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/runtests.py +0 -0
  105. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/setup.py +0 -0
  106. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_BSTR.py +0 -0
  107. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_DISPPARAMS.py +0 -0
  108. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_GUID.py +0 -0
  109. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_QueryService.py +0 -0
  110. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_agilent.py +0 -0
  111. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_avmc.py +0 -0
  112. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_bctx.py +0 -0
  113. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_casesensitivity.py +0 -0
  114. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_classfactory.py +0 -0
  115. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_clear_cache.py +0 -0
  116. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_client_dynamic.py +0 -0
  117. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_client_regenerate_modules.py +0 -0
  118. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_collections.py +0 -0
  119. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_comobject.py +0 -0
  120. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_connectionpoints.py +0 -0
  121. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_createwrappers.py +0 -0
  122. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_dict.py +0 -0
  123. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_dispifc_records.py +0 -0
  124. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_dispifc_safearrays.py +0 -0
  125. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_dispinterface.py +0 -0
  126. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_dyndispatch.py +0 -0
  127. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_errorinfo.py +0 -0
  128. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_findgendir.py +0 -0
  129. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_getactiveobj.py +0 -0
  130. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_hresult.py +0 -0
  131. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_ienum.py +0 -0
  132. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_imfattributes.py +0 -0
  133. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_inout_args.py +0 -0
  134. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_jscript.js +0 -0
  135. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_malloc.py +0 -0
  136. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_messageloop.py +0 -0
  137. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_moniker.py +0 -0
  138. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_msscript.py +0 -0
  139. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_outparam.py +0 -0
  140. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_persist.py +0 -0
  141. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_pump_events.py +0 -0
  142. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_puredispatch.py +0 -0
  143. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_recordinfo.py +0 -0
  144. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_rot.py +0 -0
  145. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_safearray.py +0 -0
  146. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_sapi.py +0 -0
  147. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_server.py +0 -0
  148. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_server_automation.py +0 -0
  149. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_server_register.py +0 -0
  150. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_shelllink.py +0 -0
  151. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_showevents.py +0 -0
  152. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_storage.py +0 -0
  153. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_stream.py +0 -0
  154. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_subinterface.py +0 -0
  155. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_typeinfo.py +0 -0
  156. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_typeinfo_create.py +0 -0
  157. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_urlhistory.py +0 -0
  158. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_util.py +0 -0
  159. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_variant_outparam.py +0 -0
  160. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_viewobject.py +0 -0
  161. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_w_getopt.py +0 -0
  162. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_win32com_interop.py +0 -0
  163. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/test_word.py +0 -0
  164. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/time_structs_helper.py +0 -0
  165. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/test/urlhist.tlb +0 -0
  166. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/__init__.py +0 -0
  167. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/__init__.py +0 -0
  168. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/tools/codegenerator/modulenamer.py +0 -0
  169. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/typeinfo.py +0 -0
  170. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes/viewobject.py +0 -0
  171. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes.egg-info/dependency_links.txt +0 -0
  172. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes.egg-info/entry_points.txt +0 -0
  173. {comtypes-1.4.16 → comtypes-1.5.0}/comtypes.egg-info/top_level.txt +0 -0
  174. {comtypes-1.4.16 → comtypes-1.5.0}/setup.cfg +0 -0
@@ -1,6 +1,43 @@
1
1
  Comtypes CHANGELOG
2
2
  ==================
3
3
 
4
+ Release 1.5.0
5
+ --------------
6
+ * Bump GitHub Actions dependencies. By @junkmd.
7
+ * Refactor enum member iteration in code generator namespaces. By @junkmd.
8
+ * Expose inline typing metadata to type checkers. By @Robolightning.
9
+ * Modernize ``test_pip_install.py`` and include in ``autofmt`` workflow. By @junkmd.
10
+ * Introduce CI type-checking harness. By @junkmd.
11
+ * Add documentations for developers on how this package supports static typing. By @junkmd.
12
+ * Restore numeric ``SAFEARRAY`` to ``numpy.ndarray`` conversion. By @haoxuanjng-lang.
13
+ * Add Python 3.15 to CI matrix. By @junkmd.
14
+ * Support Python 3.15 ``PyCArgObject`` struct layout changes. By @junkmd.
15
+ * Update the code generator to handle Python 3.15's changes to ``enum.IntFlag``. By @junkmd.
16
+ * Add tests for explicit string ``SAFEARRAY`` types inside ``VARIANT``s. By @junkmd.
17
+ * Remove ``setup_logging`` from ``comtypes.logutil``. By @junkmd.
18
+ * Support ``VT_ERROR`` variant type. By @junkmd.
19
+ * Remove ``..._Impl`` comments generation and add member‑level docstrings under ``if TYPE_CHECKING``. By @junkmd.
20
+ * Add tests to show the problems with the current ``VT_I1`` mapping in ``tlbparser``. By @haoxuanjng-lang.
21
+ * Clarify ``ctypes`` ``_b_needsfree_`` ownership in ``tagVARIANT`` and add tests. By @junkmd.
22
+ * Use ``sysmon`` for coverage on Python 3.12. By @junkmd.
23
+ * Resolve remaining type-checking errors. By @junkmd.
24
+ * Improve ``IEnumVARIANT`` type hints. By @junkmd.
25
+ * Refactor ``tlbparser`` and ``codegenerator``. By @junkmd.
26
+ * Improve fixed-point number marshaling and ``VARIANT`` support. By @junkmd.
27
+ * Add record ``SAFEARRAY`` support. By @mementum and @junkmd.
28
+ * Update docs for Python 3.15 support. By @junkmd.
29
+
30
+ Release 1.4.17
31
+ --------------
32
+ * Unify Windows message handling APIs in ``messageloop.py``. By @junkmd.
33
+ * Replace Internet Explorer with MSXML in ``test_eventinterface.py``. By @junkmd.
34
+ * Improve error handling for ``GetEvents`` with currently unsupported COM servers. By @junkmd.
35
+ * Refactor ``test_basic.py`` to use public APIs. By @junkmd.
36
+ * Skip tests using ``util`` on Python 3.15 alpha/beta. By @junkmd.
37
+ * Refine type hints for COM object creation and retrieval. By @junkmd.
38
+ * Modernize ``IGlobalInterfaceTable`` with type hints. By @junkmd.
39
+ * Fix ``UnboundLocalError`` when all struct packings fail in ``calc_packing``. By @ryanda9910.
40
+
4
41
  Release 1.4.16
5
42
  --------------
6
43
  * Decompose ``IStorage`` tests and enhance coverage. By @junkmd.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comtypes
3
- Version: 1.4.16
3
+ Version: 1.5.0
4
4
  Summary: Pure Python COM package
5
5
  Author-email: Thomas Heller <theller@python.net>
6
6
  License-Expression: MIT
@@ -33,11 +33,7 @@ Dynamic: license-file
33
33
 
34
34
  `comtypes` requires Windows and Python 3.9 or later.
35
35
 
36
- - **Note about Python 3.15 and `enum` behavior**
37
- Starting with Python 3.15, the internal handling of `IntFlag`(`Flag`) values is planned to change:
38
- **Negative `IntFlag` members will be reinterpreted by masking them to the defined positive bit domain, instead of keeping their original negative literal values**.
39
- This can affect enumeration types generated by `comtypes` from COM type libraries. Action is needed to maintain literal evaluation.
40
- For details and ongoing discussion, see: [GH-894](https://github.com/enthought/comtypes/issues/894).
36
+ - Version <= [1.4.17](https://pypi.org/project/comtypes/1.4.17/) has issues with enum behavior on Python 3.15 as reported in [GH-894](https://github.com/enthought/comtypes/issues/894). Version [1.5.0](https://pypi.org/project/comtypes/1.5.0/) supports Python 3.15.
41
37
  - Version [1.4.12](https://pypi.org/project/comtypes/1.4.12/) is the last version to support Python 3.8.
42
38
  - Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
43
39
  - Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
@@ -87,7 +83,7 @@ For as long as COM is not supported outside of Windows, there is no plan to port
87
83
 
88
84
  ### Q: Why does `cannot import name 'COMError' from '_ctypes'` error occur when using this package on platforms other than Windows?
89
85
  **A:** The [`_ctypes`](https://github.com/python/cpython/blob/main/Modules/_ctypes/_ctypes.c) is part of the internal implementation of the [`ctypes`](https://github.com/python/cpython/blob/main/Lib/ctypes/) standard library that exists for Python on all platforms.
90
- However, `COMError` and COM-related features are only implemented in Python for Windows.
86
+ However, [`COMError`](https://docs.python.org/3/library/ctypes.html#ctypes.COMError) and COM-related features are only implemented in Python for Windows.
91
87
 
92
88
  In cross-platform software development, care must be taken to ensure that codebases that depend on `comtypes` do not execute in environments other than Windows.
93
89
 
@@ -13,11 +13,7 @@
13
13
 
14
14
  `comtypes` requires Windows and Python 3.9 or later.
15
15
 
16
- - **Note about Python 3.15 and `enum` behavior**
17
- Starting with Python 3.15, the internal handling of `IntFlag`(`Flag`) values is planned to change:
18
- **Negative `IntFlag` members will be reinterpreted by masking them to the defined positive bit domain, instead of keeping their original negative literal values**.
19
- This can affect enumeration types generated by `comtypes` from COM type libraries. Action is needed to maintain literal evaluation.
20
- For details and ongoing discussion, see: [GH-894](https://github.com/enthought/comtypes/issues/894).
16
+ - Version <= [1.4.17](https://pypi.org/project/comtypes/1.4.17/) has issues with enum behavior on Python 3.15 as reported in [GH-894](https://github.com/enthought/comtypes/issues/894). Version [1.5.0](https://pypi.org/project/comtypes/1.5.0/) supports Python 3.15.
21
17
  - Version [1.4.12](https://pypi.org/project/comtypes/1.4.12/) is the last version to support Python 3.8.
22
18
  - Version <= [1.4.7](https://pypi.org/project/comtypes/1.4.7/) does not work with Python 3.13 as reported in [GH-618](https://github.com/enthought/comtypes/issues/618). Version [1.4.8](https://pypi.org/project/comtypes/1.4.8/) can work with Python 3.13.
23
19
  - Version [1.4.6](https://pypi.org/project/comtypes/1.4.6/) is the last version to support Python 3.7.
@@ -67,7 +63,7 @@ For as long as COM is not supported outside of Windows, there is no plan to port
67
63
 
68
64
  ### Q: Why does `cannot import name 'COMError' from '_ctypes'` error occur when using this package on platforms other than Windows?
69
65
  **A:** The [`_ctypes`](https://github.com/python/cpython/blob/main/Modules/_ctypes/_ctypes.c) is part of the internal implementation of the [`ctypes`](https://github.com/python/cpython/blob/main/Lib/ctypes/) standard library that exists for Python on all platforms.
70
- However, `COMError` and COM-related features are only implemented in Python for Windows.
66
+ However, [`COMError`](https://docs.python.org/3/library/ctypes.html#ctypes.COMError) and COM-related features are only implemented in Python for Windows.
71
67
 
72
68
  In cross-platform software development, care must be taken to ensure that codebases that depend on `comtypes` do not execute in environments other than Windows.
73
69
 
@@ -1,5 +1,5 @@
1
1
  # comtypes version numbers follow semver (http://semver.org/) and PEP 440
2
- __version__ = "1.4.16"
2
+ __version__ = "1.5.0"
3
3
 
4
4
  try:
5
5
  from _ctypes import COMError # noqa
@@ -18,22 +18,6 @@ import atexit
18
18
  import logging
19
19
  import sys
20
20
 
21
- if sys.version_info >= (3, 15):
22
- import warnings
23
-
24
- _PYVER = f"{sys.version_info.major}.{sys.version_info.minor}"
25
- warnings.warn(
26
- (
27
- f"You are running 'comtypes' on Python {_PYVER}, where the behavior of "
28
- "enum types (such as IntFlag) may differ from Python <= 3.14.\n"
29
- f"It is recommended to use a version compatible with Python {_PYVER}.\n"
30
- "See: https://github.com/enthought/comtypes/issues/894"
31
- ),
32
- FutureWarning,
33
- stacklevel=2,
34
- )
35
-
36
-
37
21
  # HACK: Workaround for projects that depend on this package
38
22
  # There should be several projects around the world that depend on this package
39
23
  # and indirectly reference the symbols of `ctypes` from `comtypes`.
@@ -53,8 +37,8 @@ else:
53
37
 
54
38
  from comtypes import patcher # noqa
55
39
  from comtypes._npsupport import interop as npsupport # noqa
56
- from comtypes._tlib_version_checker import _check_version # noqa
57
- from comtypes.GUID import GUID
40
+ from comtypes._tlib_version_checker import _check_version as _check_version # noqa
41
+ from comtypes.GUID import GUID as GUID
58
42
 
59
43
  _all_slice = slice(None, None, None)
60
44
 
@@ -198,31 +182,34 @@ com_coclass_registry: dict[str, type["CoClass"]] = {}
198
182
  # IDL stuff
199
183
 
200
184
  from comtypes._memberspec import ( # noqa
201
- COMMETHOD,
202
- DISPMETHOD,
203
- DISPPROPERTY,
204
- STDMETHOD,
205
- defaultvalue,
206
- dispid,
207
- helpstring,
185
+ COMMETHOD as COMMETHOD,
186
+ DISPMETHOD as DISPMETHOD,
187
+ DISPPROPERTY as DISPPROPERTY,
188
+ STDMETHOD as STDMETHOD,
189
+ defaultvalue as defaultvalue,
190
+ dispid as dispid,
191
+ helpstring as helpstring,
208
192
  )
209
193
 
210
194
  ################################################################
211
195
  # IUnknown, the root of all evil...
212
196
  from comtypes._post_coinit import _shutdown
213
- from comtypes._post_coinit.unknwn import IUnknown # noqa
197
+ from comtypes._post_coinit.unknwn import IUnknown as IUnknown # noqa
214
198
 
215
199
  atexit.register(_shutdown)
216
200
 
217
201
  ################################################################
218
202
 
219
- from comtypes._post_coinit.bstr import BSTR # noqa
203
+ from comtypes._post_coinit.bstr import BSTR as BSTR # noqa
220
204
 
221
205
 
222
206
  ################################################################
223
207
  # IPersist is a trivial interface, which allows to ask an object about
224
208
  # its clsid.
225
- from comtypes._post_coinit.misc import IPersist, IServiceProvider # noqa
209
+ from comtypes._post_coinit.misc import (
210
+ IPersist as IPersist,
211
+ IServiceProvider as IServiceProvider,
212
+ ) # noqa
226
213
 
227
214
 
228
215
  ################################################################
@@ -232,39 +219,39 @@ from comtypes._post_coinit.instancemethod import instancemethod # noqa
232
219
  from comtypes._post_coinit.activeobj import ( # noqa
233
220
  ACTIVEOBJECT_STRONG,
234
221
  ACTIVEOBJECT_WEAK,
235
- GetActiveObject,
222
+ GetActiveObject as GetActiveObject,
236
223
  RegisterActiveObject,
237
224
  RevokeActiveObject,
238
225
  )
239
226
  from comtypes._post_coinit.misc import ( # noqa
240
227
  _is_object,
241
- CoGetObject,
242
- CoCreateInstance,
243
- CoGetClassObject,
244
- MULTI_QI,
228
+ CoGetObject as CoGetObject,
229
+ CoCreateInstance as CoCreateInstance,
230
+ CoGetClassObject as CoGetClassObject,
231
+ MULTI_QI as MULTI_QI,
245
232
  _COAUTHIDENTITY,
246
- COAUTHIDENTITY,
233
+ COAUTHIDENTITY as COAUTHIDENTITY,
247
234
  _COAUTHINFO,
248
- COAUTHINFO,
235
+ COAUTHINFO as COAUTHINFO,
249
236
  _COSERVERINFO,
250
- COSERVERINFO,
237
+ COSERVERINFO as COSERVERINFO,
251
238
  _CoGetClassObject,
252
- tagBIND_OPTS,
253
- BIND_OPTS,
254
- tagBIND_OPTS2,
255
- BINDOPTS2,
239
+ tagBIND_OPTS as tagBIND_OPTS,
240
+ BIND_OPTS as BIND_OPTS,
241
+ tagBIND_OPTS2 as tagBIND_OPTS2,
242
+ BINDOPTS2 as BINDOPTS2,
256
243
  _SEC_WINNT_AUTH_IDENTITY,
257
- SEC_WINNT_AUTH_IDENTITY,
244
+ SEC_WINNT_AUTH_IDENTITY as SEC_WINNT_AUTH_IDENTITY,
258
245
  _SOLE_AUTHENTICATION_INFO,
259
- SOLE_AUTHENTICATION_INFO,
246
+ SOLE_AUTHENTICATION_INFO as SOLE_AUTHENTICATION_INFO,
260
247
  _SOLE_AUTHENTICATION_LIST,
261
- SOLE_AUTHENTICATION_LIST,
262
- CoCreateInstanceEx,
248
+ SOLE_AUTHENTICATION_LIST as SOLE_AUTHENTICATION_LIST,
249
+ CoCreateInstanceEx as CoCreateInstanceEx,
263
250
  )
264
251
 
265
252
 
266
253
  ################################################################
267
- from comtypes._comobject import COMObject
254
+ from comtypes._comobject import COMObject as COMObject
268
255
 
269
256
  # What's a coclass?
270
257
  # a POINTER to a coclass is allowed as parameter in a function declaration:
@@ -165,19 +165,88 @@ class dispid(int):
165
165
  # instances with more methods or properties, and should not behave as an unpackable.
166
166
 
167
167
 
168
- def STDMETHOD(restype, name, argtypes=()) -> _ComMemberSpec:
169
- "Specifies a COM method slot without idlflags"
170
- return _ComMemberSpec(restype, name, argtypes, None, (), None)
171
-
172
-
173
- def DISPMETHOD(idlflags, restype, name, *argspec) -> _DispMemberSpec:
174
- "Specifies a method of a dispinterface"
175
- return _DispMemberSpec("DISPMETHOD", name, tuple(idlflags), restype, argspec)
168
+ def STDMETHOD(
169
+ restype: Optional[type["_CDataType"]],
170
+ name: str,
171
+ argtypes: Sequence[type["_CDataType"]] = (),
172
+ ) -> _ComMemberSpec:
173
+ """Specifies a COM method slot without idlflags.
174
+
175
+ Use this when the method requires no parameter direction annotations
176
+ (`'in'`, `'out'`, etc.) and no helpstring. If any of those are
177
+ needed, use `COMMETHOD` instead.
178
+
179
+ Args:
180
+ restype: The return type of the vtable method. Typically
181
+ `HRESULT` or a primitive `ctypes` type.
182
+ Pass `None` when the method is declared `void`.
183
+ name: The name of the COM method.
184
+ argtypes: A sequence of `ctypes` types describing the raw
185
+ parameters of the vtable slot, in declaration order.
186
+ Defaults to an empty sequence when the method takes no
187
+ parameters.
188
+ """
189
+ return _ComMemberSpec(restype, name, tuple(argtypes), None, (), None)
190
+
191
+
192
+ def DISPMETHOD(
193
+ idlflags: Sequence[_UnionT[int, str]],
194
+ restype: Optional[type["_CDataType"]],
195
+ name: str,
196
+ *argspec: "hints.ArgSpecElmType",
197
+ ) -> _DispMemberSpec:
198
+ """Specifies a method of a dispinterface.
199
+
200
+ Args:
201
+ idlflags: A sequence that describes the method itself.
202
+ Must contain a `dispid` instance (an `int` subclass) that
203
+ carries the `DISPID` of this member. May also contain string
204
+ flags that control how the method is exposed.
205
+ restype: The return type of the dispatch method as a `ctypes`
206
+ type, or `None` when the method returns nothing (`void`).
207
+ name: The name of the dispatch method.
208
+ argspec: Zero or more argument specifiers, each describing one
209
+ parameter of the method. Each element is a tuple that can be:
210
+ - `(flags, type)` for a parameter with no name.
211
+ - `(flags, type, name)` for a named parameter.
212
+ - `(flags, type, name, default)` for a named parameter with
213
+ a default value.
214
+ - `flags` is a list of strings chosen from `'in'`, `'out'`,
215
+ `'lcid'`, `'retval'`, and `'optional'`.
216
+ Pass `[]` for a plain input parameter with no special
217
+ attributes.
218
+ """
219
+ return _DispMemberSpec(
220
+ "DISPMETHOD",
221
+ name,
222
+ tuple(idlflags), # type: ignore
223
+ restype,
224
+ argspec,
225
+ )
176
226
 
177
227
 
178
- def DISPPROPERTY(idlflags, proptype, name) -> _DispMemberSpec:
179
- "Specifies a property of a dispinterface"
180
- return _DispMemberSpec("DISPPROPERTY", name, tuple(idlflags), proptype, ())
228
+ def DISPPROPERTY(
229
+ idlflags: Sequence[_UnionT[int, str]],
230
+ proptype: type["_CDataType"],
231
+ name: str,
232
+ ) -> _DispMemberSpec:
233
+ """Specifies a property of a dispinterface.
234
+
235
+ Args:
236
+ idlflags: A sequence that describes the property itself. Must
237
+ contain a `dispid` instance (a subclass of `int`) that
238
+ carries the `DISPID` of this member. May also contain string
239
+ flags that control how the property is exposed.
240
+ proptype: The `ctypes` type of the property value.
241
+ name: The name of the dispatch property.
242
+ """
243
+ return _DispMemberSpec(
244
+ "DISPPROPERTY",
245
+ name,
246
+ tuple(idlflags), # type: ignore
247
+ proptype,
248
+ (),
249
+ )
181
250
 
182
251
 
183
252
  # tuple(idlflags) is for the method itself: (dispid, 'readonly')
@@ -189,10 +258,38 @@ def DISPPROPERTY(idlflags, proptype, name) -> _DispMemberSpec:
189
258
  # )
190
259
 
191
260
 
192
- def COMMETHOD(idlflags, restype, methodname, *argspec) -> _ComMemberSpec:
261
+ def COMMETHOD(
262
+ idlflags: Sequence[_UnionT[int, str]],
263
+ restype: Optional[type["_CDataType"]],
264
+ methodname: str,
265
+ *argspec: "hints.ArgSpecElmType",
266
+ ) -> _ComMemberSpec:
193
267
  """Specifies a COM method slot with idlflags.
194
268
 
195
- XXX should explain the sematics of the arguments.
269
+ Args:
270
+ idlflags: A sequence that describes the method or property itself.
271
+ Elements may be:
272
+ - String flags that control how the slot is exposed.
273
+ - A `helpstring` instance (a `str` subclass) whose
274
+ text is used as the method's docstring.
275
+ - A `dispid` instance (an `int` subclass) that
276
+ carries the `DISPID` when the method is part of a dual
277
+ interface.
278
+ - Pass `[]` for a regular vtable method with no special
279
+ attributes.
280
+ restype: The return type of the vtable method. Typically
281
+ `HRESULT`. Pass `None` when the method is `void`.
282
+ methodname: The name of the COM method or property.
283
+ argspec: Zero or more argument specifiers, each describing one
284
+ parameter of the method. Each element is a tuple that can be:
285
+ - `(flags, type)` for a parameter with no name.
286
+ - `(flags, type, name)` for a named parameter.
287
+ - `(flags, type, name, default)` for a named parameter with
288
+ a default value.
289
+ - `flags` is a list of strings chosen from `'in'`, `'out'`,
290
+ `'lcid'`, `'retval'`, and `'optional'`.
291
+ Pass `[]` for a plain input parameter with no special
292
+ attributes.
196
293
  """
197
294
  # collect all helpstring instances
198
295
  # We should suppress docstrings when Python is started with -OO
@@ -208,7 +305,12 @@ def COMMETHOD(idlflags, restype, methodname, *argspec) -> _ComMemberSpec:
208
305
  else:
209
306
  name = methodname
210
307
  return _ComMemberSpec(
211
- restype, name, argtypes, paramflags, tuple(idlflags), helptext
308
+ restype,
309
+ name,
310
+ argtypes,
311
+ paramflags,
312
+ tuple(idlflags), # type: ignore
313
+ helptext,
212
314
  )
213
315
 
214
316
 
@@ -14,6 +14,7 @@ from ctypes import (
14
14
  )
15
15
  from ctypes.wintypes import DWORD, LPCWSTR, LPVOID
16
16
  from typing import TYPE_CHECKING, Any, Optional, TypeVar, overload
17
+ from typing import Union as _UnionT
17
18
 
18
19
  from comtypes import CLSCTX_LOCAL_SERVER, CLSCTX_REMOTE_SERVER, CLSCTX_SERVER, GUID
19
20
  from comtypes._memberspec import COMMETHOD
@@ -21,7 +22,7 @@ from comtypes._post_coinit.unknwn import IUnknown
21
22
  from comtypes.GUID import REFCLSID
22
23
 
23
24
  if TYPE_CHECKING:
24
- from ctypes import _Pointer
25
+ from ctypes import _CArgObject, _Pointer
25
26
 
26
27
  from comtypes import hints as hints # noqa # type: ignore
27
28
 
@@ -146,20 +147,20 @@ def CoCreateInstance(
146
147
  def CoGetClassObject(
147
148
  clsid: GUID,
148
149
  clsctx: Optional[int] = None,
149
- pServerInfo: "Optional[COSERVERINFO]" = None,
150
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
150
151
  interface: None = None,
151
152
  ) -> "hints.IClassFactory": ...
152
153
  @overload
153
154
  def CoGetClassObject(
154
155
  clsid: GUID,
155
156
  clsctx: Optional[int] = None,
156
- pServerInfo: "Optional[COSERVERINFO]" = None,
157
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
157
158
  interface: type[_T_IUnknown] = IUnknown,
158
159
  ) -> _T_IUnknown: ...
159
160
  def CoGetClassObject(
160
161
  clsid: GUID,
161
162
  clsctx: Optional[int] = None,
162
- pServerInfo: "Optional[COSERVERINFO]" = None,
163
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
163
164
  interface: Optional[type[IUnknown]] = None,
164
165
  ) -> IUnknown:
165
166
  if clsctx is None:
@@ -337,7 +338,7 @@ def CoCreateInstanceEx(
337
338
  interface: None = None,
338
339
  clsctx: Optional[int] = None,
339
340
  machine: Optional[str] = None,
340
- pServerInfo: Optional[COSERVERINFO] = None,
341
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
341
342
  ) -> IUnknown: ...
342
343
  @overload
343
344
  def CoCreateInstanceEx(
@@ -345,14 +346,14 @@ def CoCreateInstanceEx(
345
346
  interface: type[_T_IUnknown],
346
347
  clsctx: Optional[int] = None,
347
348
  machine: Optional[str] = None,
348
- pServerInfo: Optional[COSERVERINFO] = None,
349
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
349
350
  ) -> _T_IUnknown: ...
350
351
  def CoCreateInstanceEx(
351
352
  clsid: GUID,
352
353
  interface: Optional[type[IUnknown]] = None,
353
354
  clsctx: Optional[int] = None,
354
355
  machine: Optional[str] = None,
355
- pServerInfo: Optional[COSERVERINFO] = None,
356
+ pServerInfo: "_UnionT[None, _CArgObject, COSERVERINFO]" = None,
356
357
  ) -> IUnknown:
357
358
  """The basic windows api to create a COM class object and return a
358
359
  pointer to an interface, possibly on another machine.
@@ -1,10 +1,16 @@
1
1
  """SAFEARRAY api functions, data types, and constants."""
2
2
 
3
- from ctypes import POINTER, Structure, WinDLL, c_uint, c_ushort, c_void_p
3
+ from ctypes import POINTER, Structure, WinDLL, byref, c_uint, c_ushort, c_void_p
4
4
  from ctypes.wintypes import DWORD, LONG, UINT, USHORT
5
+ from typing import TYPE_CHECKING
5
6
 
6
7
  from comtypes import GUID, HRESULT
7
8
 
9
+ if TYPE_CHECKING:
10
+ from ctypes import _Pointer
11
+
12
+ from comtypes import hints # type: ignore
13
+
8
14
  ################################################################
9
15
  # if __debug__:
10
16
  # from ctypeslib.dynamic_module import include
@@ -78,6 +84,31 @@ def SafeArrayGetVartype(pa):
78
84
  return result.value
79
85
 
80
86
 
87
+ _SafeArrayGetRecordInfo = _oleaut32.SafeArrayGetRecordInfo
88
+ _SafeArrayGetRecordInfo.restype = HRESULT
89
+ _SafeArrayGetRecordInfo.argtypes = [POINTER(SAFEARRAY), POINTER(c_void_p)]
90
+
91
+
92
+ def SafeArrayGetRecordInfo(pa: "_Pointer[tagSAFEARRAY]") -> "hints.IRecordInfo":
93
+ # Defined here to avoid a circular import
94
+ from comtypes.typeinfo import IRecordInfo
95
+
96
+ result = POINTER(IRecordInfo)()
97
+ _SafeArrayGetRecordInfo(pa, byref(result))
98
+ return result # type: ignore
99
+
100
+
101
+ _SafeArrayCopy = _oleaut32.SafeArrayCopy
102
+ _SafeArrayCopy.restype = HRESULT
103
+ _SafeArrayCopy.argtypes = [POINTER(SAFEARRAY), POINTER(POINTER(SAFEARRAY))]
104
+
105
+
106
+ def SafeArrayCopy(pa: "_Pointer[SAFEARRAY]") -> "hints.LP_SAFEARRAY":
107
+ result = POINTER(SAFEARRAY)()
108
+ _SafeArrayCopy(pa, byref(result))
109
+ return result # type: ignore
110
+
111
+
81
112
  SafeArrayGetElement = _oleaut32.SafeArrayGetElement
82
113
  SafeArrayGetElement.restype = HRESULT
83
114
  SafeArrayGetElement.argtypes = [POINTER(SAFEARRAY), POINTER(LONG), c_void_p]