Skip to content

update constructor args of the CFuncPtr to expand acceptable types #10155

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

Merged
merged 4 commits into from
May 7, 2023

Conversation

junkmd
Copy link
Contributor

@junkmd junkmd commented May 7, 2023

Please see #8968

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

comtypes (https://github.com/enthought/comtypes)
- comtypes/_memberspec.py:357: error: No overload variant of "_FuncPointer" matches argument types "int", "str", "None", "Optional[GUID]"  [call-overload]
- comtypes/_memberspec.py:357: note: Possible overload variants:
- comtypes/_memberspec.py:357: note:     def __init__(self) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, int, /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, Callable[..., Any], /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, Tuple[Union[str, int], CDLL], Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, int, str, Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., _Pointer[c_int] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:358: error: No overload variant of "_FuncPointer" matches argument types "int", "str", "Optional[Tuple[Union[Tuple[int, Optional[str]], Tuple[int, Optional[str], Any]], ...]]", "Optional[GUID]"  [call-overload]
- comtypes/_memberspec.py:358: note: Possible overload variants:
- comtypes/_memberspec.py:358: note:     def __init__(self) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, int, /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, Callable[..., Any], /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, Tuple[Union[str, int], CDLL], Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, int, str, Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., _Pointer[c_int] = ..., /) -> _FuncPointer

@junkmd
Copy link
Contributor Author

junkmd commented May 7, 2023

Diff from mypy_primer, showing the effect of this PR on open source code:

comtypes (https://github.com/enthought/comtypes)
- comtypes/_memberspec.py:357: error: No overload variant of "_FuncPointer" matches argument types "int", "str", "None", "Optional[GUID]"  [call-overload]
- comtypes/_memberspec.py:357: note: Possible overload variants:
- comtypes/_memberspec.py:357: note:     def __init__(self) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, int, /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, Callable[..., Any], /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, Tuple[Union[str, int], CDLL], Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:357: note:     def __init__(self, int, str, Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., _Pointer[c_int] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:358: error: No overload variant of "_FuncPointer" matches argument types "int", "str", "Optional[Tuple[Union[Tuple[int, Optional[str]], Tuple[int, Optional[str], Any]], ...]]", "Optional[GUID]"  [call-overload]
- comtypes/_memberspec.py:358: note: Possible overload variants:
- comtypes/_memberspec.py:358: note:     def __init__(self) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, int, /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, Callable[..., Any], /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, Tuple[Union[str, int], CDLL], Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., /) -> _FuncPointer
- comtypes/_memberspec.py:358: note:     def __init__(self, int, str, Tuple[Union[Tuple[int], Tuple[int, str], Tuple[int, str, Any]], ...] = ..., _Pointer[c_int] = ..., /) -> _FuncPointer

I recognize this result as the elimination of false positives in the comtypes.

@JelleZijlstra JelleZijlstra merged commit 9457de3 into python:main May 7, 2023
@junkmd junkmd deleted the update_CFuncPtr_ctor_args_types branch May 7, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants