-
-
Notifications
You must be signed in to change notification settings - Fork 102
comtypes.gen.Friendly
's __file__
, __repr__
, ... are not what they really are
#328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
comtypes.gen.Friendly
's __file__
, __repr__
are not what they really arecomtypes.gen.Friendly
's __file__
, __repr__
, ... are not what they really are
For this issue, I feel that it would be better in terms of readability (for both humans and type-hints) to simply import the symbols used in the wrapper-module one by one, rather than manipulate the objects related to the namespace. For example, from comtypes.gen import _00020430_0000_0000_C000_000000000046_0_2_0
globals().update(_00020430_0000_0000_C000_000000000046_0_2_0.__dict__)
__name__ = 'comtypes.gen.stdole' ↓ from comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0 import (
IEnumVARIANT, FONTNAME, Unchecked, _lcid, OLE_YSIZE_CONTAINER,
GUID, Checked, FONTITALIC, EXCEPINFO, _check_version,
OLE_XPOS_CONTAINER, OLE_YPOS_PIXELS, OLE_HANDLE, IFont, HRESULT,
FONTSTRIKETHROUGH, IFontEventsDisp, OLE_OPTEXCLUSIVE, Monochrome,
Picture, OLE_YPOS_CONTAINER, IPicture, BSTR, StdFont,
OLE_XPOS_HIMETRIC, DISPMETHOD, IUnknown, DISPPROPERTY, StdPicture,
OLE_YSIZE_HIMETRIC, CoClass, OLE_XSIZE_HIMETRIC, FontEvents, Gray,
COMMETHOD, FONTBOLD, Font, FONTSIZE, VgaColor, typelib_path,
dispid, OLE_XSIZE_CONTAINER, OLE_CANCELBOOL, OLE_COLOR,
OLE_TRISTATE, IDispatch, Library, OLE_YPOS_HIMETRIC,
OLE_XPOS_PIXELS, Color, DISPPARAMS, VARIANT_BOOL,
OLE_ENABLEDEFAULTBOOL, Default, FONTUNDERSCORE,
LoadPictureConstants, IFontDisp, OLE_XSIZE_PIXELS, IPictureDisp,
OLE_YSIZE_PIXELS
)
__all__ = [
'IEnumVARIANT', 'FONTNAME', 'Unchecked', '_lcid',
'OLE_YSIZE_CONTAINER', 'GUID', 'Checked', 'FONTITALIC',
'EXCEPINFO', '_check_version', 'OLE_XPOS_CONTAINER',
'OLE_YPOS_PIXELS', 'OLE_HANDLE', 'IFont', 'HRESULT',
'FONTSTRIKETHROUGH', 'IFontEventsDisp', 'OLE_OPTEXCLUSIVE',
'Monochrome', 'Picture', 'OLE_YPOS_CONTAINER', 'IPicture', 'BSTR',
'StdFont', 'OLE_XPOS_HIMETRIC', 'DISPMETHOD', 'IUnknown',
'DISPPROPERTY', 'StdPicture', 'OLE_YSIZE_HIMETRIC', 'CoClass',
'OLE_XSIZE_HIMETRIC', 'FontEvents', 'Gray', 'COMMETHOD',
'FONTBOLD', 'Font', 'FONTSIZE', 'VgaColor', 'typelib_path',
'dispid', 'OLE_XSIZE_CONTAINER', 'OLE_CANCELBOOL', 'OLE_COLOR',
'OLE_TRISTATE', 'IDispatch', 'Library', 'OLE_YPOS_HIMETRIC',
'OLE_XPOS_PIXELS', 'Color', 'DISPPARAMS', 'VARIANT_BOOL',
'OLE_ENABLEDEFAULTBOOL', 'Default', 'FONTUNDERSCORE',
'LoadPictureConstants', 'IFontDisp', 'OLE_XSIZE_PIXELS',
'IPictureDisp', 'OLE_YSIZE_PIXELS'
] |
I noticed during working on the comtypes/comtypes/tools/codegenerator.py Lines 851 to 878 in d470b62
|
Suppose that If only the symbols specified in However, for example, it is unlikely that you will import |
See #469 |
Some dunder methods or attributes in a friendly named module under
comtypes.gen
return non-intuitive values.I wish fixing it.
The text was updated successfully, but these errors were encountered: