Error/crash/hang when comparing enum value to uncomparable type

Phil Thompson phil at
Thu Oct 27 11:05:41 BST 2022

On 26/10/2022 11:49, Jean Abou Samra wrote:
> Le 24/10/2022 à 03:16, Phil Thompson a écrit :
>> 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.
> OK, I'll try to avoid that in the app.
> One more question: did the comparison "<QEvent> == <QKeySequence 
> member>"
> "work" (return True sometimes and never raise) in older versions of
> PyQt? I am wondering about this because I see lots of such comparisons
> in the app in question.

I don't think so.


More information about the PyQt mailing list