classification
Title: Add support for BigEndianUnion and LittleEndianUnion in ctypes
Type: enhancement Stage:
Components: ctypes Versions: Python 3.6, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, belopolsky, emezh, meador.inge, theller, tohyland
Priority: normal Keywords:

Created on 2018-03-29 13:48 by emezh, last changed 2019-11-04 11:10 by tohyland.

Messages (3)
msg314647 - (view) Author: emezh (emezh) Date: 2018-03-29 13:48
Python documentation says that "To build structures with non-native byte order, you can use one of the BigEndianStructure, LittleEndianStructure, BigEndianUnion, and LittleEndianUnion base classes"

However, BigEndianUnion ad LittleEndianUnion are not implemented

>>> from ctypes import *
>>> BigEndianStructure
<class 'ctypes._endian.BigEndianStructure'>
>>> BigEndianUnion
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'BigEndianUnion' is not defined

Is that something that can be added?

See also https://bugs.python.org/issue19023
msg314649 - (view) Author: emezh (emezh) Date: 2018-03-29 13:52
updated nosy list
msg355937 - (view) Author: Tomas Hyland (tohyland) * Date: 2019-11-04 11:10
Hi there, I'm taking part in 'EnHackathon' spending several days over the next few weeks working on issues. I think this could be a good issue for a small team of first-time contributors with experience in C to work on.
Would anyone be able to offer guidance if we encounter problems?
History
Date User Action Args
2019-11-04 11:10:04tohylandsetnosy: + tohyland
messages: + msg355937
2018-03-29 13:52:51emezhsetnosy: + theller, amaury.forgeotdarc, belopolsky, meador.inge
messages: + msg314649
2018-03-29 13:48:23emezhcreate