-
-
Notifications
You must be signed in to change notification settings - Fork 104
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
My priority has shifted to modifying other modules, so I hope someone else will finish this unfinished work.
Currently
Lines 511 to 516 in 30523b5
| def LoadRegTypeLib(guid, wMajorVerNum, wMinorVerNum, lcid=0): | |
| # type: (str, int, int, int) -> ITypeLib | |
| "Load a registered type library" | |
| tlib = POINTER(ITypeLib)() | |
| _oleaut32.LoadRegTypeLib(byref(GUID(guid)), wMajorVerNum, wMinorVerNum, lcid, byref(tlib)) | |
| return tlib # type: ignore |
Suggested change
def LoadRegTypeLib(guid, wMajorVerNum, wMinorVerNum, lcid=0):
# type: (_UnionT[str, GUID], int, int, int) -> ITypeLib
"""Load a registered type library"""
...Ratiole
The constructor arg of GUID will be casted to text_type.
Lines 40 to 42 in 30523b5
| def __init__(self, name=None): | |
| if name is not None: | |
| _CLSIDFromString(text_type(name), byref(self)) |
And str(GUID("xxxxxxxx-...")) will return 'xxxxxxxx-...'.
Lines 47 to 53 in 30523b5
| def __unicode__(self): | |
| p = c_wchar_p() | |
| _StringFromCLSID(byref(self), byref(p)) | |
| result = p.value | |
| _CoTaskMemFree(p) | |
| return result | |
| __str__ = __unicode__ |
Thus, there is no problem guid argument is either str or GUID.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers