Skip to content

Update ctypes stubs for Python3.12 #10290

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 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stdlib/_ctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ RTLD_LOCAL: int
if sys.version_info >= (3, 11):
CTYPES_MAX_ARGCOUNT: int

if sys.version_info >= (3, 12):
SIZEOF_TIME_T: int

if sys.platform == "win32":
# Description, Source, HelpFile, HelpContext, scode
_COMError_Details: TypeAlias = tuple[str | None, str | None, str | None, int | None, int | None]
Expand Down
3 changes: 3 additions & 0 deletions stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ class c_bool(_SimpleCData[bool]):
if sys.platform == "win32":
class HRESULT(_SimpleCData[int]): ... # TODO undocumented

if sys.version_info >= (3, 12):
c_time_t: type[c_int32 | c_int64]

class py_object(_CanCastTo, _SimpleCData[_T]): ...
class BigEndianStructure(Structure): ...
class LittleEndianStructure(Structure): ...
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Uncategorised, from Python 3.12
_ctypes.SIZEOF_TIME_T
argparse.BooleanOptionalAction.__init__
array.array.__class_getitem__
asyncio.BaseEventLoop.create_connection
Expand All @@ -22,7 +21,6 @@ collections.UserDict.get
configparser.ParsingError.__init__
configparser.RawConfigParser.readfp
configparser.__all__
ctypes.c_time_t
datetime.__all__
email.utils.localtime
enum.Enum.__signature__
Expand Down