Comparing None with QByteArray starting with a null byte is inappropriate/inconsistent

Maurizio Berti maurizio.berti at gmail.com
Wed Apr 23 01:05:11 BST 2025


I just discovered that the following comparison behaves differently on
PyQt5 and PyQt6:

None == QByteArray(b'\0')

In PyQt6 it properly returns False, but in PyQt5 it returns True, which I
believe wrong, especially since the result is unchanged no matter what
follows that first byte, which is obviously inappropriate.

I tested only on 5.15.10 and 6.7.1.

Best regards,
MaurizioB

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250423/6c0366db/attachment.htm>


More information about the PyQt mailing list