Repository navigation
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. |
|
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__.pyito_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_SimpleCDataArrayAnd I fixed
stubtest_allowlistfor_ctypes.Array.