Description
The current implementation of QByteArray is broken:
- we should define the possible constructors,
- the special methods _str_ and _repr_ need to be available
- the possible operations needs to be defined (+?, *?)
Keep in mind that we need to be Python 2 and 3 compatible,
so we should provide a solution that is available using PyString_* methods and types (for python 2),
and also PyUnicode_* (for python 3)
A few questions are:
- Should we treat a QByteArray as a PyByteArray or a String/Unicode ?
- Should we treat Bytes as PyBytes? or Strings/Unicodes?
- Since we are not providing a binding for QString, and instead we are using Python Strings, what should be the internal representation? (wchar_t?, char?, unsigned char?)
There is currently a patch that try to solve this issue:
https://codereview.qt-project.org/#/c/229678/
and a couple of bugs related to this issue:
https://bugreports.qt.io/browse/PYSIDE-232
https://bugreports.qt.io/browse/PYSIDE-336
https://bugreports.qt.io/browse/PYSIDE-100
https://bugreports.qt.io/browse/PYSIDE-664
Attachments
For Gerrit Dashboard: PYSIDE-669 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
231388,3 | Adapt examples to proper QByteArray constructor | 5.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |