Skip to content

Commit

Permalink
Improve _CArrayType alias import. (#596)
Browse files Browse the repository at this point in the history
* Change to annotate the `_CArrayType` for fields that were annotated with `Array`.

* Improve `_CArrayType` alias import.
  • Loading branch information
junkmd committed Aug 7, 2024
1 parent a6ea0c3 commit 82e4a2d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions comtypes/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import decimal
import sys
from ctypes import *
from ctypes import _Pointer
from ctypes import _Pointer, Array as _CArrayType
from _ctypes import CopyComPointer
from ctypes.wintypes import DWORD, LONG, UINT, VARIANT_BOOL, WCHAR, WORD
from typing import Any, ClassVar, Dict, List, Optional, TYPE_CHECKING, Type
Expand Down Expand Up @@ -610,7 +610,6 @@ def ChangeType(self, typecode):
del v

_carg_obj = type(byref(c_int()))
from ctypes import Array as _CArrayType


@comtypes.patcher.Patch(POINTER(VARIANT))
Expand Down Expand Up @@ -750,7 +749,7 @@ def __repr__(self):

class tagDISPPARAMS(Structure):
if TYPE_CHECKING:
rgvarg: Array[VARIANT]
rgvarg: _CArrayType[VARIANT]
rgdispidNamedArgs: _Pointer[DISPID]
cArgs: int
cNamedArgs: int
Expand Down

0 comments on commit 82e4a2d

Please sign in to comment.