This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Wieser
Recipients Eric Wieser, docs@python
Date 2019-06-07.03:46:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559879196.85.0.0861364976154.issue37187@roundup.psfhosted.org>
In-reply-to
Content
This behavior is pretty surprising:

```python
import ctypes

class Simple(ctypes.Structure):
    _fields_ = [
        ('a', ctypes.c_uint8),
        ('b', ctypes.c_uint8),
    ]

class Bitfields(ctypes.Structure):
    _fields_ = [
        ('a', ctypes.c_uint8, 8),
        ('b', ctypes.c_uint8, 8),
    ]

print(Simple.b.size)     # 1
print(Bitfields.b.size)  # 262148
```

The docstring for this field, from `help(type(Bitfields.b).size)`, is:

> Help on getset descriptor _ctypes.CField.size:
>
> size
>    size in bytes of this field

So either the behavior or the docstring needs to change.
History
Date User Action Args
2019-06-07 03:46:36Eric Wiesersetrecipients: + Eric Wieser, docs@python
2019-06-07 03:46:36Eric Wiesersetmessageid: <1559879196.85.0.0861364976154.issue37187@roundup.psfhosted.org>
2019-06-07 03:46:36Eric Wieserlinkissue37187 messages
2019-06-07 03:46:36Eric Wiesercreate