Error/crash/hang when comparing enum value to uncomparable type
Phil Thompson
phil at riverbankcomputing.com
Mon Oct 24 02:16:32 BST 2022
On 24/10/2022 01:45, Jean Abou Samra wrote:
> Le 24/10/2022 à 02:37, Phil Thompson a écrit :
>> No. A Python exception has been raised in a Python re-implementation
>> of a C++ virtual. See...
>>
>> https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#unhandled-python-exceptions
>
>
> OK, thanks, that explains the failure mode, but why is there an error
> in the first place?
PyQt5 enums don't support comparisons with strings. You could argue that
it should return False for any unsupported type (as PyQt6 does) but it's
far too late in the lifespan of PyQt5 to change the behaviour.
Phil
More information about the PyQt
mailing list