Pelokalan
Python ID
id en
Masuk
Proyek
whatsnew__3-14.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
ctypes
ctypes
The layout of :ref:`bit fields <ctypes-bit-fields-in-structures-unions>` in :class:`~ctypes.Structure` and :class:`~ctypes.Union` objects is now a closer match to platform defaults (GCC/Clang or MSVC). In particular, fields no longer overlap. (Contributed by Matthias Görgens in :gh:`97702`.)
The class of :class:`~ctypes.Structure`/:class:`~ctypes.Union` field descriptors is now available as :class:`~ctypes.CField`, and has new attributes to aid debugging and introspection. (Contributed by Petr Viktorin in :gh:`128715`.)
On Windows, the :exc:`~ctypes.COMError` exception is now public. (Contributed by Jun Komoda in :gh:`126686`.)
On Windows, the :func:`~ctypes.CopyComPointer` function is now public. (Contributed by Jun Komoda in :gh:`127275`.)
Add :func:`~ctypes.memoryview_at`, a function to create a :class:`memoryview` object that refers to the supplied pointer and length. This works like :func:`ctypes.string_at` except it avoids a buffer copy, and is typically useful when implementing pure Python callback functions that are passed dynamically-sized buffers. (Contributed by Rian Hunter in :gh:`112018`.)
Complex types, :class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex`, and :class:`~ctypes.c_longdouble_complex`, are now available if both the compiler and the ``libffi`` library support complex C types. (Contributed by Sergey B Kirpichev in :gh:`61103`.)
Add :func:`ctypes.util.dllist` for listing the shared libraries loaded by the current process. (Contributed by Brian Ward in :gh:`119349`.)
Move :func:`ctypes.POINTER` types cache from a global internal cache (``_pointer_type_cache``) to the :attr:`_CData.__pointer_type__ <ctypes._CData.__pointer_type__>` attribute of the corresponding :mod:`!ctypes` types. This will stop the cache from growing without limits in some situations. (Contributed by Sergey Miryanov in :gh:`100926`.)
The :class:`~ctypes.py_object` type now supports subscription, making it a :term:`generic type`. (Contributed by Brian Schubert in :gh:`132168`.)
:mod:`!ctypes` now supports :term:`free-threading builds <free threading>`. (Contributed by Kumar Aditya and Peter Bierma in :gh:`127945`.)
:mod:`ctypes`:
:mod:`ctypes`:
Calling :func:`ctypes.POINTER` on a string is now deprecated. Use :ref:`incomplete types <ctypes-incomplete-types>` for self-referential structures. Also, the internal ``ctypes._pointer_type_cache`` is deprecated. See :func:`ctypes.POINTER` for updated implementation details. (Contributed by Sergey Myrianov in :gh:`100926`.)
The undocumented :func:`!ctypes.SetPointerType` function has been deprecated since Python 3.13.
Implicitly switching to the MSVC-compatible struct layout by setting :attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-Windows platforms.
:mod:`ctypes`
:mod:`!ctypes.macholib`
:pep:`776`: Emscripten is now an officially supported platform at :pep:`tier 3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten libc`__ were fixed. Emscripten now includes support for :mod:`ctypes`, :mod:`termios`, and :mod:`fcntl`, as well as experimental support for the new :ref:`default interactive shell <tut-interactive>`. (Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:`136931`.)