typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

[stdlib] update `ctypes.CField`

Open guoci opened this issue 1 month ago • 10 comments

docs: https://docs.python.org/3/library/ctypes.html#ctypes.CField

guoci avatar Nov 19 '25 16:11 guoci

As far as I can see, this class was only added in 3.14 "for real". So we need to distinguish between those cases.

srittau avatar Nov 19 '25 16:11 srittau

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 19 '25 16:11 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 19 '25 16:11 github-actions[bot]

I need help with resolving the remaining errors

guoci avatar Nov 19 '25 17:11 guoci

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 19 '25 17:11 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 19 '25 22:11 github-actions[bot]

It appears that the attribute name type is causing the error. If I rename it to _type_, it works fine. See: https://github.com/python/typeshed/pull/15057

guoci avatar Nov 20 '25 15:11 guoci

I think it's best to have to complete separate _CField classes, one for 3.14+ and one for < 3.14. This way we can keep the @type_check_only decorator and it could alleviate some of the problems.

srittau avatar Nov 20 '25 16:11 srittau

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 20 '25 17:11 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Nov 20 '25 18:11 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Dec 20 '25 19:12 github-actions[bot]