Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-57089: Note _layout_ in the bitfield docs #134148

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from
Open
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
12 changes: 9 additions & 3 deletions 12 Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,16 @@ item in the :attr:`~Structure._fields_` tuples::
... ("second_16", c_int, 16)]
...
>>> print(Int.first_16)
<Field type=c_long, ofs=0:0, bits=16>
<ctypes.CField 'first_16' type=c_int, ofs=0, bit_size=16, bit_offset=0>
>>> print(Int.second_16)
<Field type=c_long, ofs=0:16, bits=16>
>>>
<ctypes.CField 'second_16' type=c_int, ofs=0, bit_size=16, bit_offset=16>

It is important to note that bit field allocation and layout in memory is not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is important to note that bit field allocation and layout in memory is not
It is important to note that bit field allocation and layout in memory are not

Subject consists of two parts

defined as a C standard; its implementation is compiler-specific.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defined as a C standard; its implementation is compiler-specific.
defined as a C standard; their implementation is compiler-specific.

By default, Python will attempt to match the behavior of a "native" compiler
for the current platform.
See the :attr:`~Structure._layout_` attribute for details on the default
behavior and how to change it.


.. _ctypes-arrays:
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.