From 065477c1d121943e524a233b139a3de561317f83 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 1 Jan 2026 18:04:26 +0400 Subject: [PATCH] [ctypes] Soft deprecate ARRAY Source: https://github.com/python/cpython/pull/122281 --- stdlib/ctypes/__init__.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index be2e7449ef31..8d048aa97e7d 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -169,11 +169,12 @@ def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_w if sys.version_info >= (3, 13): @deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.") def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ... + @deprecated("Soft deprecated since Python 3.13. Use multiplication instead.") + def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... else: def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ... - -def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to remove + def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... if sys.platform == "win32": def DllCanUnloadNow() -> int: ...