-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
move some stuffs related to _SimpleCData
from ctypes/__init__.pyi
to _ctypes.pyi
, as at runtime.
#10118
move some stuffs related to _SimpleCData
from ctypes/__init__.pyi
to _ctypes.pyi
, as at runtime.
#10118
Conversation
- `_CDataMeta` - `_CData` - `_SimpleCData` - `Array` - fix `stubtest_allowlist`
Thank you for the correction in 727ceb8. |
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.
Thank you!
Diff from mypy_primer, showing the effect of this PR on open source code: psycopg (https://github.com/psycopg/psycopg)
+ psycopg/psycopg/pq/pq_ctypes.py:1026: error: Returning Any from function declared to return "bytes" [no-any-return]
discord.py (https://github.com/Rapptz/discord.py)
- discord/opus.py:377: error: Value of type variable "_T" of "array" cannot be "bytes" [type-var]
|
It looks like this interferes slightly with mypy's plugin for typechecking It should be fairly easy to fix; I can make a PR to mypy. |
Excellent. 👍 It would be very helpful to have you do this. |
Hmm, actually, looks like it might not be possible to fix the mypy plugin (or might be pretty difficult to do so) unless it's done after mypy updates their vendored copy of typeshed following this change. @hauntsaninja, do you reckon it's okay to merge this for now, and fix mypy after the next typeshed sync? |
Yeah, that sounds good! |
related to #8633 and #8571 (comment)
#10111 and google/pytype#1411 (commit; google/pytype@2e2088f) have enabled us to move definitions from
__init__.pyi
to_ctypes.pyi
.(#8633 (comment))There are no longer causes CI to fail
So I'm going to contribute for the first time in several months.
I have moved the following stuffs.
_CDataMeta
_CData
_SimpleCData
Array
And I fixed
stubtest_allowlist
for_ctypes.Array.