-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ctypes.POINTER(None)
returns ctypes.c_void_p
#12754
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
Conversation
This comment has been minimized.
This comment has been minimized.
As per the discussion in the the issue, it might be worth adding some tests (in Other than that, I think that the overload to allow |
This comment has been minimized.
This comment has been minimized.
I read your comment and https://github.com/python/typeshed/blob/main/tests/REGRESSION.md. I have committed what I thought should be added to And it seems there's already |
Oh that's an easy fix. Just gotta make sure the filename is different. You could rename your test |
Diff from mypy_primer, showing the effect of this PR on open source code: comtypes (https://github.com/enthought/comtypes)
- comtypes/typeinfo.py:511: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/typeinfo.py:511: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:511: note: Possible overload variants:
+ comtypes/typeinfo.py:511: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:511: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/typeinfo.py:830: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
- comtypes/typeinfo.py:842: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
- comtypes/typeinfo.py:868: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
- comtypes/typeinfo.py:1036: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
+ comtypes/typeinfo.py:830: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:830: note: Possible overload variants:
+ comtypes/typeinfo.py:830: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:830: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/typeinfo.py:842: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:842: note: Possible overload variants:
+ comtypes/typeinfo.py:842: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:842: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/typeinfo.py:868: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:868: note: Possible overload variants:
+ comtypes/typeinfo.py:868: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:868: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/typeinfo.py:1036: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:1036: note: Possible overload variants:
+ comtypes/typeinfo.py:1036: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:1036: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/typeinfo.py:1102: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/typeinfo.py:1102: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/typeinfo.py:1102: note: Possible overload variants:
+ comtypes/typeinfo.py:1102: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/typeinfo.py:1102: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/safearray.py:70: error: Unused "type: ignore" comment [unused-ignore]
- comtypes/errorinfo.py:13: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/errorinfo.py:13: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/errorinfo.py:13: note: Possible overload variants:
+ comtypes/errorinfo.py:13: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/errorinfo.py:13: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/errorinfo.py:24: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/errorinfo.py:24: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/errorinfo.py:24: note: Possible overload variants:
+ comtypes/errorinfo.py:24: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/errorinfo.py:24: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/errorinfo.py:42: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/errorinfo.py:42: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/errorinfo.py:42: note: Possible overload variants:
+ comtypes/errorinfo.py:42: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/errorinfo.py:42: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/_post_coinit/unknwn.py:521: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
+ comtypes/_post_coinit/unknwn.py:521: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/unknwn.py:521: note: Possible overload variants:
+ comtypes/_post_coinit/unknwn.py:521: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/unknwn.py:521: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/_post_coinit/misc.py:51: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/_post_coinit/misc.py:51: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:51: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:51: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:51: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/_post_coinit/misc.py:80: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
- comtypes/_post_coinit/misc.py:81: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/_post_coinit/misc.py:80: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:80: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:80: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:80: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/_post_coinit/misc.py:81: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:81: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:81: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:81: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/_post_coinit/misc.py:188: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Never]" [arg-type]
+ comtypes/_post_coinit/misc.py:188: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:188: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:188: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:188: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
- comtypes/_post_coinit/misc.py:242: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
- comtypes/_post_coinit/misc.py:245: error: Argument 1 to "POINTER" has incompatible type Module; expected "type[Any]" [arg-type]
+ comtypes/_post_coinit/misc.py:242: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:242: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:242: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:242: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
+ comtypes/_post_coinit/misc.py:245: error: No overload variant of "POINTER" matches argument type Module [call-overload]
+ comtypes/_post_coinit/misc.py:245: note: Possible overload variants:
+ comtypes/_post_coinit/misc.py:245: note: def POINTER(None, /) -> type[c_void_p]
+ comtypes/_post_coinit/misc.py:245: note: def [_CT: _CData] POINTER(type[_CT], /) -> type[_Pointer[_CT]]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The primer output is just changed error messages.
After following your advice and using
No objection. |
Fixes #12736.